chenxiYan commited on
Commit
4602ea9
1 Parent(s): 91b7e59

delete history

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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])