12.24 禅道bug修改

This commit is contained in:
zy123 2024-12-24 09:28:07 +08:00
parent a94877ddb7
commit 27d973de3c
3 changed files with 8 additions and 9 deletions

View File

@ -110,7 +110,7 @@ def format_chinese_date(date_str):
if __name__ == "__main__": if __name__ == "__main__":
input_dates = [ input_dates = [
# 完整的日期和时间 # 完整的日期和时间
"开标日期是2021年 6月 18日 15点 00分", "2022 年 8 月 18 日 下午 16 :0 0",
"2019年7月18日0930", "2019年7月18日0930",
"20 19 年7 月18日 09 30整北京时间", "20 19 年7 月18日 09 30整北京时间",
"2020年02月05日12时30分45秒", "2020年02月05日12时30分45秒",

View File

@ -524,7 +524,6 @@ def handle_query(file_path, user_query, output_file, result_key, keywords):
# Proceed only if there is content to write # Proceed only if there is content to write
selected_contents = set() # 使用 set 去重 selected_contents = set() # 使用 set 去重
if qianwen_txt: if qianwen_txt:
print(qianwen_txt)
with open(output_file, 'w', encoding='utf-8') as file: with open(output_file, 'w', encoding='utf-8') as file:
counter = 1 counter = 1
for content in qianwen_txt: for content in qianwen_txt:

View File

@ -1,10 +1,10 @@
import concurrent.futures import concurrent.futures
import os 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 函数 使用多线程同时调用 qianwen_long 函数
参数 参数
@ -41,11 +41,11 @@ def multi_threaded_calls(file_id, user_query, num_threads=10):
if __name__ == "__main__": if __name__ == "__main__":
# 定义参数 # 定义参数
# file_path = r"C:\Users\Administrator\Desktop\货物标\截取test\2-招标文件_before.pdf" 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 = upload_file(file_path)
file_id = "file-fe-ah0F0SJUY2cEzPx5nONRBvwd" # file_id = "file-fe-ah0F0SJUY2cEzPx5nONRBvwd"
user_query = "项目名称是?" user_query = "该招标文件的项目概况是项目基本情况是请按json格式给我提供信息键名分别为'项目概况','项目基本情况',若存在嵌套信息,嵌套内容键名以文件中对应字段命名,而嵌套键值必须与原文保持一致,若存在未知信息,在对应的键值中填'未知'"
num_threads = 200 # 并发线程数量 num_threads = 1 # 并发线程数量
# 执行多线程调用 # 执行多线程调用
responses = multi_threaded_calls(file_id, user_query, num_threads) responses = multi_threaded_calls(file_id, user_query, num_threads)
# 打印所有响应 # 打印所有响应