zhichyu commited on
Commit
aa2e210
·
1 Parent(s): 8e1cb41

Fix position_int on infinity (#4144)

Browse files

### What problem does this PR solve?

Fix position_int on infinity

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Files changed (2) hide show
  1. docker/.env +1 -1
  2. rag/utils/infinity_conn.py +2 -2
docker/.env CHANGED
@@ -52,7 +52,7 @@ MYSQL_DBNAME=rag_flow
52
  # allowing EXTERNAL access to the MySQL database running inside the Docker container.
53
  MYSQL_PORT=5455
54
 
55
- # The hostname where the MySQL service is exposed
56
  MINIO_HOST=minio
57
  # The port used to expose the MinIO console interface to the host machine,
58
  # allowing EXTERNAL access to the web-based console running inside the Docker container.
 
52
  # allowing EXTERNAL access to the MySQL database running inside the Docker container.
53
  MYSQL_PORT=5455
54
 
55
+ # The hostname where the MinIO service is exposed
56
  MINIO_HOST=minio
57
  # The port used to expose the MinIO console interface to the host machine,
58
  # allowing EXTERNAL access to the web-based console running inside the Docker container.
rag/utils/infinity_conn.py CHANGED
@@ -404,7 +404,7 @@ class InfinityConnection(DocStoreConnection):
404
  assert isinstance(v, list)
405
  arr = [num for row in v for num in row]
406
  d[k] = "_".join(f"{num:08x}" for num in arr)
407
- elif k in ["page_num_int", "top_int", "position_int"]:
408
  assert isinstance(v, list)
409
  d[k] = "_".join(f"{num:08x}" for num in v)
410
  ids = ["'{}'".format(d["id"]) for d in documents]
@@ -508,7 +508,7 @@ class InfinityConnection(DocStoreConnection):
508
  assert isinstance(v, str)
509
  if v:
510
  arr = [int(hex_val, 16) for hex_val in v.split('_')]
511
- v = [arr[i:i + 4] for i in range(0, len(arr), 4)]
512
  else:
513
  v = []
514
  elif fieldnm in ["page_num_int", "top_int"]:
 
404
  assert isinstance(v, list)
405
  arr = [num for row in v for num in row]
406
  d[k] = "_".join(f"{num:08x}" for num in arr)
407
+ elif k in ["page_num_int", "top_int"]:
408
  assert isinstance(v, list)
409
  d[k] = "_".join(f"{num:08x}" for num in v)
410
  ids = ["'{}'".format(d["id"]) for d in documents]
 
508
  assert isinstance(v, str)
509
  if v:
510
  arr = [int(hex_val, 16) for hex_val in v.split('_')]
511
+ v = [arr[i:i + 5] for i in range(0, len(arr), 5)]
512
  else:
513
  v = []
514
  elif fieldnm in ["page_num_int", "top_int"]: