Spaces:
Sleeping
Sleeping
ganchengguang
commited on
Commit
•
ad0aa53
1
Parent(s):
763c74b
Update app.py
Browse files
app.py
CHANGED
@@ -34,6 +34,8 @@ def respond(message, language, task, max_tokens):
|
|
34 |
)
|
35 |
# 解码回复
|
36 |
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
|
|
|
|
37 |
return response
|
38 |
|
39 |
# 更新任务选项的函数
|
@@ -42,7 +44,7 @@ def update_tasks(language):
|
|
42 |
|
43 |
# 创建Gradio接口
|
44 |
with gr.Blocks() as demo:
|
45 |
-
gr.Markdown("#
|
46 |
language = gr.Dropdown(label="Language", choices=list(options.keys()), value="English")
|
47 |
task = gr.Dropdown(label="Task", choices=list(options['English'].keys()))
|
48 |
message = gr.Textbox(label="Input Text")
|
|
|
34 |
)
|
35 |
# 解码回复
|
36 |
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
37 |
+
# 去除输入部分
|
38 |
+
response = response[len(user_message):].strip()
|
39 |
return response
|
40 |
|
41 |
# 更新任务选项的函数
|
|
|
44 |
|
45 |
# 创建Gradio接口
|
46 |
with gr.Blocks() as demo:
|
47 |
+
gr.Markdown("# Open-domain Information Extraction Large Language Models Demo")
|
48 |
language = gr.Dropdown(label="Language", choices=list(options.keys()), value="English")
|
49 |
task = gr.Dropdown(label="Task", choices=list(options['English'].keys()))
|
50 |
message = gr.Textbox(label="Input Text")
|