12.24 禅道bug修改
This commit is contained in:
parent
a94877ddb7
commit
27d973de3c
@ -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秒",
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
# 打印所有响应
|
||||
|
Loading…
x
Reference in New Issue
Block a user