Pārlūkot izejas kodu

Fix position_int on infinity (#4144)

### What problem does this PR solve?

Fix position_int on infinity

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.15.1
Zhichang Yu pirms 10 mēnešiem
vecāks
revīzija
a0dc9e1bdf
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
2 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 1
    1
      docker/.env
  2. 2
    2
      rag/utils/infinity_conn.py

+ 1
- 1
docker/.env Parādīt failu

@@ -52,7 +52,7 @@ MYSQL_DBNAME=rag_flow
# allowing EXTERNAL access to the MySQL database running inside the Docker container.
MYSQL_PORT=5455

# The hostname where the MySQL service is exposed
# The hostname where the MinIO service is exposed
MINIO_HOST=minio
# The port used to expose the MinIO console interface to the host machine,
# allowing EXTERNAL access to the web-based console running inside the Docker container.

+ 2
- 2
rag/utils/infinity_conn.py Parādīt failu

@@ -404,7 +404,7 @@ class InfinityConnection(DocStoreConnection):
assert isinstance(v, list)
arr = [num for row in v for num in row]
d[k] = "_".join(f"{num:08x}" for num in arr)
elif k in ["page_num_int", "top_int", "position_int"]:
elif k in ["page_num_int", "top_int"]:
assert isinstance(v, list)
d[k] = "_".join(f"{num:08x}" for num in v)
ids = ["'{}'".format(d["id"]) for d in documents]
@@ -508,7 +508,7 @@ class InfinityConnection(DocStoreConnection):
assert isinstance(v, str)
if v:
arr = [int(hex_val, 16) for hex_val in v.split('_')]
v = [arr[i:i + 4] for i in range(0, len(arr), 4)]
v = [arr[i:i + 5] for i in range(0, len(arr), 5)]
else:
v = []
elif fieldnm in ["page_num_int", "top_int"]:

Notiek ielāde…
Atcelt
Saglabāt