Spaces:
Runtime error
Runtime error
delete history
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ def clear(user_name, user_text, chatbot):
|
|
51 |
|
52 |
def get_image(role):
|
53 |
role_en = NAME_DICT[role]
|
54 |
-
return Image.open(f'images/{role_en}.jpg')
|
55 |
|
56 |
|
57 |
with gr.Blocks() as demo:
|
@@ -89,7 +89,7 @@ with gr.Blocks() as demo:
|
|
89 |
'Sheldon', 'Raj', 'Penny',
|
90 |
'韦小宝', '乔峰', '神里绫华',
|
91 |
'雷电将军', '于谦'], label="characters", value='凉宫春日')
|
92 |
-
role.change(get_image, role, role_image)
|
93 |
user_text.submit(fn=get_response, inputs=[user_name, user_text, role, chatbot], outputs=[chatbot])
|
94 |
submit.click(fn=get_response, inputs=[user_name, user_text, role, chatbot], outputs=[chatbot])
|
95 |
clean.click(clear, [user_name, user_text, chatbot], [user_name, user_text, chatbot])
|
|
|
51 |
|
52 |
def get_image(role):
|
53 |
role_en = NAME_DICT[role]
|
54 |
+
return Image.open(f'images/{role_en}.jpg'), None, None, []
|
55 |
|
56 |
|
57 |
with gr.Blocks() as demo:
|
|
|
89 |
'Sheldon', 'Raj', 'Penny',
|
90 |
'韦小宝', '乔峰', '神里绫华',
|
91 |
'雷电将军', '于谦'], label="characters", value='凉宫春日')
|
92 |
+
role.change(get_image, role, [role_image, user_name, user_text, chatbot])
|
93 |
user_text.submit(fn=get_response, inputs=[user_name, user_text, role, chatbot], outputs=[chatbot])
|
94 |
submit.click(fn=get_response, inputs=[user_name, user_text, role, chatbot], outputs=[chatbot])
|
95 |
clean.click(clear, [user_name, user_text, chatbot], [user_name, user_text, chatbot])
|