SreyanG-NVIDIA commited on
Commit
8ba4304
Β·
verified Β·
1 Parent(s): cffa0cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -153,7 +153,7 @@ with gr.Blocks(css="""
153
  with gr.Row():
154
  with gr.Column():
155
  audio_input_single = gr.Audio(type="filepath", label="Upload Audio")
156
- prompt_input_single = gr.Textbox(label="Prompt", placeholder="Ask a question about the audio...")
157
  btn_single = gr.Button("Generate Answer")
158
 
159
  gr.Examples(
@@ -170,12 +170,12 @@ with gr.Blocks(css="""
170
  output_single = gr.Textbox(label="Model Response", lines=8)
171
 
172
  btn_single.click(fn=single_turn_infer, inputs=[audio_input_single, prompt_input_single], outputs=output_single)
173
- with gr.Tab("πŸ€” AF-Think"):
174
 
175
  with gr.Row():
176
  with gr.Column():
177
  audio_input_think = gr.Audio(type="filepath", label="Upload Audio")
178
- prompt_input_think = gr.Textbox(label="Prompt", placeholder="Ask a question about the audio...")
179
  btn_think = gr.Button("Generate Answer")
180
 
181
  gr.Examples(
@@ -183,7 +183,7 @@ with gr.Blocks(css="""
183
  ["static/think/audio1.wav", "What are the two people doing in the audio Choose the correct option from the following options:\n(A) One person is demonstrating how to use the equipment\n(B) The two people are discussing how to use the equipment\n(C) The two people are disassembling the equipment\n(D) One person is teaching another person how to use a piece of equipment\nPlease think and reason about the input audio before you respond."],
184
  ["static/think/audio2.wav", "Is the boat in the video moving closer or further away? Choose the correct option from the following options:\n(A) Closer\n(B) Further\nPlease think and reason about the input audio before you respond."],
185
  ],
186
- inputs=[audio_input_think, prompt_input_think],
187
  label="πŸ§ͺ Try Examples"
188
  )
189
 
@@ -195,7 +195,7 @@ with gr.Blocks(css="""
195
  with gr.Tab("πŸ’¬ Multi-Turn Chat"):
196
  chatbot = gr.Chatbot(label="Audio Chatbot")
197
  audio_input_multi = gr.Audio(type="filepath", label="Upload or Replace Audio Context")
198
- user_input_multi = gr.Textbox(label="Your message", placeholder="Ask a question about the audio...")
199
  btn_multi = gr.Button("Send")
200
  history_state = gr.State([]) # Chat history
201
  current_audio_state = gr.State(None) # Most recent audio file path
 
153
  with gr.Row():
154
  with gr.Column():
155
  audio_input_single = gr.Audio(type="filepath", label="Upload Audio")
156
+ prompt_input_single = gr.Textbox(label="Prompt", placeholder="Ask a question about the audio...", lines=8)
157
  btn_single = gr.Button("Generate Answer")
158
 
159
  gr.Examples(
 
170
  output_single = gr.Textbox(label="Model Response", lines=8)
171
 
172
  btn_single.click(fn=single_turn_infer, inputs=[audio_input_single, prompt_input_single], outputs=output_single)
173
+ with gr.Tab("πŸ€” Think / Long"):
174
 
175
  with gr.Row():
176
  with gr.Column():
177
  audio_input_think = gr.Audio(type="filepath", label="Upload Audio")
178
+ prompt_input_think = gr.Textbox(label="Prompt", placeholder="Ask a question about the audio...", lines=8)
179
  btn_think = gr.Button("Generate Answer")
180
 
181
  gr.Examples(
 
183
  ["static/think/audio1.wav", "What are the two people doing in the audio Choose the correct option from the following options:\n(A) One person is demonstrating how to use the equipment\n(B) The two people are discussing how to use the equipment\n(C) The two people are disassembling the equipment\n(D) One person is teaching another person how to use a piece of equipment\nPlease think and reason about the input audio before you respond."],
184
  ["static/think/audio2.wav", "Is the boat in the video moving closer or further away? Choose the correct option from the following options:\n(A) Closer\n(B) Further\nPlease think and reason about the input audio before you respond."],
185
  ],
186
+ inputs=[audio_input_think, prompt_input_think+"\nPlease think and reason about the input music before you respond."],
187
  label="πŸ§ͺ Try Examples"
188
  )
189
 
 
195
  with gr.Tab("πŸ’¬ Multi-Turn Chat"):
196
  chatbot = gr.Chatbot(label="Audio Chatbot")
197
  audio_input_multi = gr.Audio(type="filepath", label="Upload or Replace Audio Context")
198
+ user_input_multi = gr.Textbox(label="Your message", placeholder="Ask a question about the audio...", lines=8)
199
  btn_multi = gr.Button("Send")
200
  history_state = gr.State([]) # Chat history
201
  current_audio_state = gr.State(None) # Most recent audio file path