RamAnanth1 commited on
Commit
7a9a684
·
1 Parent(s): 73ff64a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -12
app.py CHANGED
@@ -14,7 +14,7 @@ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
14
 
15
  whisper_model = pipeline(
16
  task="automatic-speech-recognition",
17
- model="openai/whisper-large-v2",
18
  chunk_length_s=30,
19
  device=device,
20
  )
@@ -152,19 +152,22 @@ with gr.Blocks(title='Talk to chatGPT') as demo:
152
  with gr.Row(elem_id="chat_row"):
153
  chatbot = gr.Chatbot(elem_id="chat_bot", visible=False).style(color_map=("green", "blue"))
154
  chatbot1 = gr.Chatbot(elem_id="chat_bot1").style(color_map=("green", "blue"))
155
- with gr.Row(elem_id="prompt_row"):
156
- prompt_input_audio = gr.Audio(label = 'Record Audio Input',source="microphone",type="filepath")
 
 
 
 
 
 
 
 
 
 
 
 
157
  prompt_input = gr.Textbox(lines=2, label="Input text",show_label=True)
158
  chat_history = gr.Textbox(lines=4, label="prompt", visible=False)
159
- translate_btn = gr.Button(value = "Translate").style(
160
- margin=True,
161
- rounded=(True, True, True, True),
162
- width=100
163
- )
164
- translate_btn.click(fn=translate,
165
- inputs=prompt_input_audio,
166
- outputs=prompt_input
167
- )
168
  submit_btn = gr.Button(value = "Submit",elem_id="submit-btn").style(
169
  margin=True,
170
  rounded=(True, True, True, True),
 
14
 
15
  whisper_model = pipeline(
16
  task="automatic-speech-recognition",
17
+ model="openai/whisper-small",
18
  chunk_length_s=30,
19
  device=device,
20
  )
 
152
  with gr.Row(elem_id="chat_row"):
153
  chatbot = gr.Chatbot(elem_id="chat_bot", visible=False).style(color_map=("green", "blue"))
154
  chatbot1 = gr.Chatbot(elem_id="chat_bot1").style(color_map=("green", "blue"))
155
+ with gr.Row(elem_id="prompt_row"):
156
+ with gr.Column():
157
+ prompt_input_audio = gr.Audio(
158
+ source="microphone",
159
+ type="filepath",
160
+ label="Record Audio Input",
161
+
162
+ )
163
+ with gr.Row():
164
+ translate_btn = gr.Button("Check Whisper first ? 👍")
165
+ translate_btn.click(fn=translate,
166
+ inputs=prompt_input_audio,
167
+ outputs=prompt_input
168
+ )
169
  prompt_input = gr.Textbox(lines=2, label="Input text",show_label=True)
170
  chat_history = gr.Textbox(lines=4, label="prompt", visible=False)
 
 
 
 
 
 
 
 
 
171
  submit_btn = gr.Button(value = "Submit",elem_id="submit-btn").style(
172
  margin=True,
173
  rounded=(True, True, True, True),