changdazhou 9 months ago
parent
commit
f872f64475

+ 0 - 3
paddlex/inference/pipelines/components/retriever/base.py

@@ -138,7 +138,6 @@ class BaseRetriever(ABC, metaclass=AutoRegisterABCMetaClass):
                 documents=all_splits, embedding=self.embedding
             )
         except ValueError as e:
-            print(e)
             vectorstore = None
 
         return vectorstore
@@ -182,8 +181,6 @@ class BaseRetriever(ABC, metaclass=AutoRegisterABCMetaClass):
             logging.warning("The retrieved vectorstore is empty,will empty vector.")
             return None
 
-        print(vectorstore)
-
         vector = vectorstores.FAISS.deserialize_from_bytes(
             vectorstore,
             embeddings=self.embedding,

+ 4 - 4
paddlex/inference/pipelines/pp_chatocr/pipeline_v3.py

@@ -169,10 +169,11 @@ class PP_ChatOCRv3_Pipeline(PP_ChatOCR_Pipeline):
             content = parsing_res_list[pno]["block_content"]
             if label in ["table", "formula"]:
                 continue
-            if label not in normal_text_dict:
-                normal_text_dict["words in " + label] = content
+            key = f"words in {label}"
+            if key not in normal_text_dict:
+                normal_text_dict[key] = content
             else:
-                normal_text_dict["words in " + label] += f"\n {content}"
+                normal_text_dict[key] += f"\n {content}"
 
         table_res_list = layout_parsing_result["table_res_list"]
         table_text_list = []
@@ -260,7 +261,6 @@ class PP_ChatOCRv3_Pipeline(PP_ChatOCR_Pipeline):
             seal_det_unclip_ratio=seal_det_unclip_ratio,
             seal_rec_score_thresh=seal_rec_score_thresh,
         ):
-
             visual_info = self.decode_visual_result(layout_parsing_result)
 
             visual_predict_res = {

+ 4 - 3
paddlex/inference/pipelines/pp_chatocr/pipeline_v4.py

@@ -203,10 +203,11 @@ class PP_ChatOCRv4_Pipeline(PP_ChatOCR_Pipeline):
             content = parsing_res_list[pno]["block_content"]
             if label in ["table", "formula"]:
                 continue
-            if label not in normal_text_dict:
-                normal_text_dict["words in " + label] = content
+            key = f"words in {label}"
+            if key not in normal_text_dict:
+                normal_text_dict[key] = content
             else:
-                normal_text_dict["words in " + label] += f"\n {content}"
+                normal_text_dict[key] += f"\n {content}"
 
         table_res_list = layout_parsing_result["table_res_list"]
         table_text_list = []