This commit is contained in:
jeremy 2025-02-11 15:06:03 +08:00
parent 89275bc509
commit 3fe75b6fc5
4 changed files with 7 additions and 15 deletions

8
.idea/.gitignore generated vendored
View File

@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -43,7 +43,7 @@ def upload_file(file_path,output_folder=""):
return file_id
@sleep_and_retry
@limits(calls=8, period=1) # 每秒最多调用4次
@limits(calls=5, period=1) # 每秒最多调用4次
def rate_limiter():
pass # 这个函数本身不执行任何操作,只用于限流
@ -272,7 +272,7 @@ def qianwen_long_stream(file_id, user_query, max_retries=2, backoff_factor=1.0,
return ""
@sleep_and_retry
@limits(calls=8, period=1) # 每秒最多调用4次
@limits(calls=4, period=1) # 每秒最多调用4次
def qianwen_plus(user_query, need_extra=False):
logger = logging.getLogger('model_log') # 通过日志名字获取记录器
print("call qianwen-plus...")

View File

@ -664,7 +664,7 @@ def extract_pages_tobidders_notice(pdf_path, output_folder, begin_page, common_h
r'(?<!对应\s*)(?<!根据\s*)(?<!按照\s*)(?<!见\s*)(?<!与\s*)(?<!同\s*)(?<!"\s*)(?<!“\s*)(?<!”\s*)(?:投标人?|磋商|谈判|供应商|应答人|比选申请人).*须知前附表\s*$',
regex.MULTILINE
)
start_page, mid_page, end_page = run_extraction(new_begin_pattern, extraction_stage='third')
start_page, mid_page, end_page = run_extraction(pdf_document, new_begin_pattern, extraction_stage='third')
if start_page is not None and mid_page is not None and end_page is not None:
return perform_extraction_and_save(start_page, mid_page, end_page)
else:

View File

@ -28,10 +28,10 @@ def create_app():
app.register_blueprint(upload_bp)
app.register_blueprint(test_zbparse_bp)
app.register_blueprint(judge_zbfile_bp)
app.connection_limiters['upload'] = ConnectionLimiter(max_connections=10)
app.connection_limiters['get_deviation'] = ConnectionLimiter(max_connections=10)
app.connection_limiters['default'] = ConnectionLimiter(max_connections=10)
app.connection_limiters['judge_zbfile'] = ConnectionLimiter(max_connections=30)
app.connection_limiters['upload'] = ConnectionLimiter(max_connections=100)
app.connection_limiters['get_deviation'] = ConnectionLimiter(max_connections=100)
app.connection_limiters['default'] = ConnectionLimiter(max_connections=100)
app.connection_limiters['judge_zbfile'] = ConnectionLimiter(max_connections=100)
@app.teardown_request
def teardown_request(exception):