adinarayana commited on
Commit
abe4e34
·
verified ·
1 Parent(s): 1fc1f7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,5 +1,5 @@
1
  from transformers import pipeline
2
- from gradio import Interface
3
 
4
  # Create a pipeline for text-to-speech
5
  tts = pipeline("text-to-speech", model="facebook/mms-tts-eng")
@@ -19,10 +19,10 @@ def voice_chat(user_voice):
19
  audio = tts(chat_reply)["audio"]
20
  return chat_reply, audio
21
 
22
- text_reply = Interface.Text(label="ChatGPT Text")
23
- voice_reply = Interface.Audio(type="audio/wav")
24
 
25
- Interface(
26
  title="AI Voice Assistant with ChatGPT AI",
27
  fn=voice_chat,
28
  inputs=[Interface.Audio(source="microphone", type="filepath")],
 
1
  from transformers import pipeline
2
+ import gradio as gr
3
 
4
  # Create a pipeline for text-to-speech
5
  tts = pipeline("text-to-speech", model="facebook/mms-tts-eng")
 
19
  audio = tts(chat_reply)["audio"]
20
  return chat_reply, audio
21
 
22
+ text_reply = gr.Textbox(label="ChatGPT Text")
23
+ voice_reply = gr.Audio('output.wav')
24
 
25
+ gr.Interface(
26
  title="AI Voice Assistant with ChatGPT AI",
27
  fn=voice_chat,
28
  inputs=[Interface.Audio(source="microphone", type="filepath")],