Zihao Wang commited on
Commit
0ff155a
·
1 Parent(s): 0e6a998

increase timeout limit

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -283,14 +283,14 @@ def rat(question):
283
  print(f"{datetime.now()} [INFO] 草稿被切分为{len(draft_paragraphs)}部分")
284
  answer = ""
285
  for i, p in enumerate(draft_paragraphs):
286
- print(str(i)*80)
287
  print(f"{datetime.now()} [INFO] 修改第{i+1}/{len(draft_paragraphs)}部分...")
288
  answer = answer + '\n\n' + p
289
  # print(f"[{i}/{len(draft_paragraphs)}] Original Answer:\n{answer.replace(newline_char, ' ')}")
290
 
291
  # query = get_query(question, answer)
292
  print(f"{datetime.now()} [INFO] 生成对应Query...")
293
- res = run_with_timeout(get_query_wrapper, 3, question, answer)
294
  if not res:
295
  print(f"{datetime.now()} [INFO] 生成检索词超时,跳过后续步骤...")
296
  continue
@@ -300,7 +300,7 @@ def rat(question):
300
 
301
  print(f"{datetime.now()} [INFO] 获取网页内容...")
302
  # content = get_content(query)
303
- res = run_with_timeout(get_content_wrapper, 5, query)
304
  if not res:
305
  print(f"{datetime.now()} [INFO] 获取网页内容超时,跳过后续步骤...")
306
  continue
 
283
  print(f"{datetime.now()} [INFO] 草稿被切分为{len(draft_paragraphs)}部分")
284
  answer = ""
285
  for i, p in enumerate(draft_paragraphs):
286
+ # print(str(i)*80)
287
  print(f"{datetime.now()} [INFO] 修改第{i+1}/{len(draft_paragraphs)}部分...")
288
  answer = answer + '\n\n' + p
289
  # print(f"[{i}/{len(draft_paragraphs)}] Original Answer:\n{answer.replace(newline_char, ' ')}")
290
 
291
  # query = get_query(question, answer)
292
  print(f"{datetime.now()} [INFO] 生成对应Query...")
293
+ res = run_with_timeout(get_query_wrapper, 10, question, answer)
294
  if not res:
295
  print(f"{datetime.now()} [INFO] 生成检索词超时,跳过后续步骤...")
296
  continue
 
300
 
301
  print(f"{datetime.now()} [INFO] 获取网页内容...")
302
  # content = get_content(query)
303
+ res = run_with_timeout(get_content_wrapper, 10, query)
304
  if not res:
305
  print(f"{datetime.now()} [INFO] 获取网页内容超时,跳过后续步骤...")
306
  continue