浏览代码

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 10 个月前
父节点
当前提交
a0dc9e1bdf
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1
    1
      docker/.env
  2. 2
    2
      rag/utils/infinity_conn.py

+ 1
- 1
docker/.env 查看文件

@@ -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 查看文件

@@ -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"]:

正在加载...
取消
保存