Przeglądaj źródła

Trivals. (#8597)

### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.20.0
Kevin Hu 4 miesięcy temu
rodzic
commit
e3edcc3064
No account linked to committer's email address

+ 5
- 1
api/utils/log_utils.py Wyświetl plik

def log_exception(e, *args): def log_exception(e, *args):
logging.exception(e) logging.exception(e)
for a in args: for a in args:
logging.error(str(a))
if hasattr(a, "text"):
logging.error(a.text)
raise Exception(a.text)
else:
logging.error(str(a))
raise e raise e

+ 1
- 1
graphrag/general/index.py Wyświetl plik



subgraph = await generate_subgraph( subgraph = await generate_subgraph(
LightKGExt LightKGExt
if "method" not in row["kb_parser_config"]["graphrag"] or row["kb_parser_config"]["graphrag"]["method"] != "general"
if "method" not in row["kb_parser_config"].get("graphrag", {}) or row["kb_parser_config"]["graphrag"]["method"] != "general"
else GeneralKGExt, else GeneralKGExt,
tenant_id, tenant_id,
kb_id, kb_id,

+ 2
- 1
rag/svr/task_executor.py Wyświetl plik

d["image"].close() # Close original image d["image"].close() # Close original image
d["image"] = converted_image d["image"] = converted_image
d["image"].save(output_buffer, format='JPEG') d["image"].save(output_buffer, format='JPEG')
d["image"].close() # Close PIL image after saving
async with minio_limiter: async with minio_limiter:
await trio.to_thread.run_sync(lambda: STORAGE_IMPL.put(task["kb_id"], d["id"], output_buffer.getvalue())) await trio.to_thread.run_sync(lambda: STORAGE_IMPL.put(task["kb_id"], d["id"], output_buffer.getvalue()))
d["img_id"] = "{}-{}".format(task["kb_id"], d["id"]) d["img_id"] = "{}-{}".format(task["kb_id"], d["id"])
if not isinstance(d["image"], bytes):
d["image"].close()
del d["image"] # Remove image reference del d["image"] # Remove image reference
docs.append(d) docs.append(d)
finally: finally:

Ładowanie…
Anuluj
Zapisz