mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-01 16:15:07 +08:00
refactor: remove debug print statements (#12534)
### What problem does this PR solve? refactor: remove debug print statements ### Type of change - [x] Refactoring
This commit is contained in:
@ -124,18 +124,13 @@ def vision_figure_parser_pdf_wrapper(tbls, callback=None, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
def vision_figure_parser_docx_wrapper_naive(chunks, idx_lst, callback=None, **kwargs):
|
def vision_figure_parser_docx_wrapper_naive(chunks, idx_lst, callback=None, **kwargs):
|
||||||
|
|
||||||
print("\n\n hello here i am \n\n")
|
|
||||||
|
|
||||||
if not chunks:
|
if not chunks:
|
||||||
return []
|
return []
|
||||||
try:
|
try:
|
||||||
vision_model = LLMBundle(kwargs["tenant_id"], LLMType.IMAGE2TEXT)
|
vision_model = LLMBundle(kwargs["tenant_id"], LLMType.IMAGE2TEXT)
|
||||||
callback(0.7, "Visual model detected. Attempting to enhance figure extraction...")
|
callback(0.7, "Visual model detected. Attempting to enhance figure extraction...")
|
||||||
print(" \n\n Yes vision model \n\n")
|
|
||||||
except Exception:
|
except Exception:
|
||||||
vision_model = None
|
vision_model = None
|
||||||
print(" \n\n No vision model \n\n")
|
|
||||||
if vision_model:
|
if vision_model:
|
||||||
@timeout(30, 3)
|
@timeout(30, 3)
|
||||||
def worker(idx, ck):
|
def worker(idx, ck):
|
||||||
|
|||||||
@ -82,8 +82,6 @@ def chunk(filename, binary=None, from_page=0, to_page=100000, lang="Chinese", ca
|
|||||||
cks.append({"text": text, "image": image, "ck_type": ck_type})
|
cks.append({"text": text, "image": image, "ck_type": ck_type})
|
||||||
|
|
||||||
vision_figure_parser_docx_wrapper_naive(cks, image_idxs, callback, **kwargs)
|
vision_figure_parser_docx_wrapper_naive(cks, image_idxs, callback, **kwargs)
|
||||||
for ck in cks:
|
|
||||||
print(ck)
|
|
||||||
sections = [ck["text"] for ck in cks if ck.get("text")]
|
sections = [ck["text"] for ck in cks if ck.get("text")]
|
||||||
callback(0.8, "Finish parsing.")
|
callback(0.8, "Finish parsing.")
|
||||||
|
|
||||||
|
|||||||
@ -815,11 +815,6 @@ def append_context2table_image4pdf(sections: list, tabls: list, table_context_si
|
|||||||
if len(contexts) < len(res) + 1:
|
if len(contexts) < len(res) + 1:
|
||||||
contexts.append(("", ""))
|
contexts.append(("", ""))
|
||||||
res.append(((img, tb), poss))
|
res.append(((img, tb), poss))
|
||||||
|
|
||||||
print("\n\n")
|
|
||||||
for c in contexts:
|
|
||||||
print(c)
|
|
||||||
print("\n\n")
|
|
||||||
return contexts if return_context else res
|
return contexts if return_context else res
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user