DiamondYin commited on
Commit
76177a8
1 Parent(s): 715c7ef

update0723

Browse files
Files changed (2) hide show
  1. app.py +6 -5
  2. assets/NPCtest1.png +0 -0
app.py CHANGED
@@ -108,7 +108,8 @@ with gr.Blocks(title="Your Assistance Pal!") as demo:
108
  with gr.Row():
109
  output_html = gr.HTML(label="Felix's Voice", value=AUDIO_HTML)
110
  output_html.visible = False
111
- assistant_character = gr.HTML(label=None, value=CHAR_IDLE_HTML, show_label=False)
 
112
  with gr.Column(scale=0.1):
113
  chatbot = gr.Chatbot(label='Send a text or a voice input').style(height=285)
114
  with gr.Row():
@@ -118,14 +119,14 @@ with gr.Blocks(title="Your Assistance Pal!") as demo:
118
  button = gr.Button(value="Send")
119
 
120
  msg.submit(get_chat_history, [msg, chatbot], [msg, chatbot]
121
- ).then(update_img, outputs=[assistant_character]
122
  ).then(get_response, [chatbot, audio_input], [chatbot, output_html]
123
- ).then(update_img, outputs=[assistant_character])
124
 
125
  button.click(get_chat_history, [msg, chatbot], [msg, chatbot]
126
- ).then(update_img, outputs=[assistant_character]
127
  ).then(get_response, [chatbot, audio_input], [chatbot, output_html]
128
- ).then(update_img, outputs=[assistant_character])
129
 
130
  # buzz_usr_proc.start()
131
 
 
108
  with gr.Row():
109
  output_html = gr.HTML(label="Felix's Voice", value=AUDIO_HTML)
110
  output_html.visible = False
111
+ image1= gr.Image(source="assets/NPCtest1.png", scale=0.5)
112
+ #assistant_character = gr.HTML(label=None, value=CHAR_IDLE_HTML, show_label=False)
113
  with gr.Column(scale=0.1):
114
  chatbot = gr.Chatbot(label='Send a text or a voice input').style(height=285)
115
  with gr.Row():
 
119
  button = gr.Button(value="Send")
120
 
121
  msg.submit(get_chat_history, [msg, chatbot], [msg, chatbot]
122
+ ).then(update_img, outputs=[""]#assistant_character
123
  ).then(get_response, [chatbot, audio_input], [chatbot, output_html]
124
+ ).then(update_img, outputs=[""])#assistant_character
125
 
126
  button.click(get_chat_history, [msg, chatbot], [msg, chatbot]
127
+ ).then(update_img, outputs=[""]#assistant_character
128
  ).then(get_response, [chatbot, audio_input], [chatbot, output_html]
129
+ ).then(update_img, outputs=[""])#assistant_character
130
 
131
  # buzz_usr_proc.start()
132
 
assets/NPCtest1.png ADDED