From 27d973de3c946bd5e4e04cf73151bfd218fb4bac Mon Sep 17 00:00:00 2001 From: zy123 <646228430@qq.com> Date: Tue, 24 Dec 2024 09:28:07 +0800 Subject: [PATCH] =?UTF-8?q?12.24=20=E7=A6=85=E9=81=93bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flask_app/general/format_date.py | 2 +- flask_app/general/无效标和废标公共代码.py | 1 - flask_app/test_case/test_qianwen_long.py | 14 +++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/flask_app/general/format_date.py b/flask_app/general/format_date.py index 8f62887..b0a82fb 100644 --- a/flask_app/general/format_date.py +++ b/flask_app/general/format_date.py @@ -110,7 +110,7 @@ def format_chinese_date(date_str): if __name__ == "__main__": input_dates = [ # 完整的日期和时间 - "开标日期是2021年 6月 18日 15点 00分", + "2022 年 8 月 18 日 下午 16 :0 0", "2019年7月18日09:30", "20 19 年7 月18日 09: 30整(北京时间)", "2020年02月05日12时30分45秒", diff --git a/flask_app/general/无效标和废标公共代码.py b/flask_app/general/无效标和废标公共代码.py index 8541dbd..41bbe1c 100644 --- a/flask_app/general/无效标和废标公共代码.py +++ b/flask_app/general/无效标和废标公共代码.py @@ -524,7 +524,6 @@ def handle_query(file_path, user_query, output_file, result_key, keywords): # Proceed only if there is content to write selected_contents = set() # 使用 set 去重 if qianwen_txt: - print(qianwen_txt) with open(output_file, 'w', encoding='utf-8') as file: counter = 1 for content in qianwen_txt: diff --git a/flask_app/test_case/test_qianwen_long.py b/flask_app/test_case/test_qianwen_long.py index 09dd91f..cf3e0a0 100644 --- a/flask_app/test_case/test_qianwen_long.py +++ b/flask_app/test_case/test_qianwen_long.py @@ -1,10 +1,10 @@ import concurrent.futures import os -from flask_app.general.通义千问long import qianwen_long +from flask_app.general.通义千问long import qianwen_long, upload_file -def multi_threaded_calls(file_id, user_query, num_threads=10): +def multi_threaded_calls(file_id, user_query, num_threads=1): """ 使用多线程同时调用 qianwen_long 函数。 参数: @@ -41,11 +41,11 @@ def multi_threaded_calls(file_id, user_query, num_threads=10): if __name__ == "__main__": # 定义参数 - # file_path = r"C:\Users\Administrator\Desktop\货物标\截取test\2-招标文件_before.pdf" - # file_id = upload_file(file_path) - file_id = "file-fe-ah0F0SJUY2cEzPx5nONRBvwd" - user_query = "项目名称是?" - num_threads = 200 # 并发线程数量 + file_path = r"D:\flask_project\flask_app\static\output\output1\8bb07ee1-bcbb-4244-9d1e-367a783f1e40\invalid_del.docx" + file_id = upload_file(file_path) + # file_id = "file-fe-ah0F0SJUY2cEzPx5nONRBvwd" + user_query = "该招标文件的项目概况是?项目基本情况是?请按json格式给我提供信息,键名分别为'项目概况','项目基本情况',若存在嵌套信息,嵌套内容键名以文件中对应字段命名,而嵌套键值必须与原文保持一致,若存在未知信息,在对应的键值中填'未知'。" + num_threads = 1 # 并发线程数量 # 执行多线程调用 responses = multi_threaded_calls(file_id, user_query, num_threads) # 打印所有响应