|
737 | 737 | " file_content_type=None,\n", |
738 | 738 | " response_type=\"application/json\"\n", |
739 | 739 | "):\n", |
740 | | - " logger.debug(\n", |
741 | | - " f\"\\npipeline_api input params:\\n\"\n", |
742 | | - " f\"filename: {filename}\\n\"\n", |
743 | | - " f\"m_strategy: {m_strategy}\\n\"\n", |
744 | | - " f\"m_coordinates: {m_coordinates}\\n\"\n", |
745 | | - " f\"m_ocr_languages: {m_ocr_languages}\\n\"\n", |
746 | | - " f\"m_encoding: {m_encoding}\\n\"\n", |
747 | | - " f\"m_xml_keep_tags: {m_xml_keep_tags}\\n\"\n", |
748 | | - " f\"m_pdf_infer_table_structure: {m_pdf_infer_table_structure}\\n\"\n", |
749 | | - " f\"m_hi_res_model_name: {m_hi_res_model_name}\\n\"\n", |
750 | | - " f\"file_content_type: {file_content_type}\\n\"\n", |
751 | | - " f\"response_type: {response_type}\"\n", |
| 740 | + " logger.debug(\"pipeline_api input params: {}\".format(\n", |
| 741 | + " json.dumps({\n", |
| 742 | + " \"request\": request,\n", |
| 743 | + " \"filename\": filename,\n", |
| 744 | + " \"m_strategy\": m_strategy,\n", |
| 745 | + " \"m_coordinates\": m_coordinates,\n", |
| 746 | + " \"m_ocr_languages\": m_ocr_languages,\n", |
| 747 | + " \"m_encoding\": m_encoding,\n", |
| 748 | + " \"m_xml_keep_tags\": m_xml_keep_tags,\n", |
| 749 | + " \"m_pdf_infer_table_structure\": m_pdf_infer_table_structure,\n", |
| 750 | + " \"m_hi_res_model_name\": m_hi_res_model_name,\n", |
| 751 | + " \"file_content_type\": file_content_type,\n", |
| 752 | + " \"response_type\": response_type\n", |
| 753 | + " }, default=str\n", |
752 | 754 | " )\n", |
| 755 | + " ))\n", |
753 | 756 | " if filename.endswith(\".msg\"):\n", |
754 | 757 | " # Note(yuming): convert file type for msg files\n", |
755 | 758 | " # since fast api might sent the wrong one.\n", |
|
791 | 794 | " pdf_infer_table_structure = False\n", |
792 | 795 | " \n", |
793 | 796 | " try:\n", |
794 | | - " logger.debug(\n", |
795 | | - " f\"\\npartition input data:\\n\"\n", |
796 | | - " f\"content_type: {file_content_type}\\n\"\n", |
797 | | - " f\"strategy: {strategy}\\n\"\n", |
798 | | - " f\"ocr_languages: {ocr_languages}\\n\"\n", |
799 | | - " f\"coordinates: {show_coordinates}\\n\"\n", |
800 | | - " f\"pdf_infer_table_structure: {pdf_infer_table_structure}\\n\"\n", |
801 | | - " f\"encoding: {encoding}\\n\"\n", |
802 | | - " f\"model_name: {hi_res_model_name}\\n\"\n", |
803 | | - " f\"xml_keep_tags: {xml_keep_tags}\\n\"\n", |
804 | | - " )\n", |
| 797 | + " logger.debug(\"partition input data: {}\".format(\n", |
| 798 | + " json.dumps({\n", |
| 799 | + " \"content_type\": file_content_type,\n", |
| 800 | + " \"strategy\": strategy,\n", |
| 801 | + " \"ocr_languages\": ocr_languages,\n", |
| 802 | + " \"coordinates\": show_coordinates,\n", |
| 803 | + " \"pdf_infer_table_structure\": pdf_infer_table_structure,\n", |
| 804 | + " \"encoding\": encoding,\n", |
| 805 | + " \"model_name\": hi_res_model_name,\n", |
| 806 | + " \"xml_keep_tags\": xml_keep_tags\n", |
| 807 | + " }, default=str)\n", |
| 808 | + " ))\n", |
805 | 809 | " \n", |
806 | 810 | " if file_content_type == \"application/pdf\" and pdf_parallel_mode_enabled:\n", |
807 | 811 | " elements = partition_pdf_splits(\n", |
|
0 commit comments