RamAnanth1 commited on
Commit
49faccd
·
1 Parent(s): 14f4cd9

Comment voice to debug

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -19,9 +19,9 @@ whisper_model = pipeline(
19
  device=device,
20
  )
21
 
22
- def transcribe(audio):
23
- text = whisper_model(audio)["text"]
24
- return text
25
 
26
  def get_response_from_chatbot(text):
27
  try:
@@ -147,18 +147,18 @@ with gr.Blocks(title='Talk to chatGPT') as demo:
147
  chatbot = gr.Chatbot(elem_id="chat_bot", visible=False).style(color_map=("green", "blue"))
148
  chatbot1 = gr.Chatbot(elem_id="chat_bot1").style(color_map=("green", "blue"))
149
  with gr.Row(elem_id="prompt_row"):
150
- prompt_input_audio = gr.Audio(label = 'Record Audio Input',source="microphone",type="filepath")
151
  prompt_input = gr.Textbox(lines=2, label="Input text",show_label=True)
152
  chat_history = gr.Textbox(lines=4, label="prompt", visible=False)
153
- transcribe_btn = gr.Button(value = "Transcribe").style(
154
- margin=True,
155
- rounded=(True, True, True, True),
156
- width=100
157
- )
158
- transcribe_btn.click(fn=transcribe,
159
- inputs=prompt_input_audio,
160
- outputs=prompt_input
161
- )
162
  submit_btn = gr.Button(value = "Submit",elem_id="submit-btn").style(
163
  margin=True,
164
  rounded=(True, True, True, True),
 
19
  device=device,
20
  )
21
 
22
+ # def transcribe(audio):
23
+ # text = whisper_model(audio)["text"]
24
+ # return text
25
 
26
  def get_response_from_chatbot(text):
27
  try:
 
147
  chatbot = gr.Chatbot(elem_id="chat_bot", visible=False).style(color_map=("green", "blue"))
148
  chatbot1 = gr.Chatbot(elem_id="chat_bot1").style(color_map=("green", "blue"))
149
  with gr.Row(elem_id="prompt_row"):
150
+ #prompt_input_audio = gr.Audio(label = 'Record Audio Input',source="microphone",type="filepath")
151
  prompt_input = gr.Textbox(lines=2, label="Input text",show_label=True)
152
  chat_history = gr.Textbox(lines=4, label="prompt", visible=False)
153
+ # transcribe_btn = gr.Button(value = "Transcribe").style(
154
+ # margin=True,
155
+ # rounded=(True, True, True, True),
156
+ # width=100
157
+ # )
158
+ # transcribe_btn.click(fn=transcribe,
159
+ # inputs=prompt_input_audio,
160
+ # outputs=prompt_input
161
+ # )
162
  submit_btn = gr.Button(value = "Submit",elem_id="submit-btn").style(
163
  margin=True,
164
  rounded=(True, True, True, True),