Merge branch 'master' into wps_i18n

合并msater
This commit is contained in:
w_xiaolizu
2023-05-18 15:38:28 +08:00
3 changed files with 31 additions and 10 deletions

View File

@ -8,6 +8,7 @@ body:
attributes:
label: Installation Method | 安装方法与平台
options:
- Please choose | 请选择
- Pip Install (I used latest requirements.txt and python>=3.8)
- Anaconda (I used latest requirements.txt and python>=3.8)
- DockerWindows/Mac
@ -22,11 +23,19 @@ body:
- type: textarea
id: describe
attributes:
label: Describe the bug & Screen Shot | 简述 与 有帮助的截图
description: Describe the bug & Screen Shot | 简述 与 有帮助的截图
label: Describe the bug | 简述
description: Describe the bug | 简述
validations:
required: true
- type: textarea
id: screenshot
attributes:
label: Screen Shot | 有帮助的截图
description: Screen Shot | 有帮助的截图
validations:
required: true
- type: textarea
id: traceback
attributes:

View File

@ -36,14 +36,18 @@ def get_meta_information(url, chatbot, history):
max_results = 1,
sort_by = arxiv.SortCriterion.Relevance,
)
paper = next(search.results())
if string_similar(title, paper.title) > 0.90: # same paper
abstract = paper.summary.replace('\n', ' ')
is_paper_in_arxiv = True
else: # different paper
try:
paper = next(search.results())
if string_similar(title, paper.title) > 0.90: # same paper
abstract = paper.summary.replace('\n', ' ')
is_paper_in_arxiv = True
else: # different paper
abstract = abstract
is_paper_in_arxiv = False
paper = next(search.results())
except:
abstract = abstract
is_paper_in_arxiv = False
paper = next(search.results())
print(title)
print(author)
print(citation)

View File

@ -166,7 +166,15 @@ def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_promp
if stream:
stream_response = response.iter_lines()
while True:
chunk = next(stream_response)
try:
chunk = next(stream_response)
except StopIteration:
# 非OpenAI官方接口的出现这样的报错OpenAI和API2D不会走这里
from toolbox import regular_txt_to_markdown; tb_str = '```\n' + trimmed_format_exc() + '```'
chatbot[-1] = (chatbot[-1][0], f"[Local Message] 远程返回错误: \n\n{tb_str} \n\n{regular_txt_to_markdown(chunk.decode())}")
yield from update_ui(chatbot=chatbot, history=history, msg="远程返回错误:" + chunk.decode()) # 刷新界面
return
# print(chunk.decode()[6:])
if is_head_of_the_stream and (r'"object":"error"' not in chunk.decode()):
# 数据流的第一帧不携带content