Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,20 +6,6 @@ import os
|
|
6 |
|
7 |
openai.api_key = os.environ.get('OPENAI_API_KEY')
|
8 |
|
9 |
-
css = """
|
10 |
-
#col-container {max-width: 80%; margin-left: auto; margin-right: auto;}
|
11 |
-
#header {text-align: center;}
|
12 |
-
}
|
13 |
-
"""
|
14 |
-
with gr.Blocks(css=css) as ui:
|
15 |
-
|
16 |
-
with gr.Column(elem_id="col-container"):
|
17 |
-
gr.Markdown("""## Talk to AI Steve Jobs: Audio-to-Text+Audio generation
|
18 |
-
Powered by ChatGPT + Whisper + ElevenLabs + HuggingFace <br>
|
19 |
-
<br>
|
20 |
-
""",
|
21 |
-
elem_id="header")
|
22 |
-
|
23 |
|
24 |
messages = [{"role": "system", "content": 'You are Steve Jobs. Respond to all input in 25 words or less.'}]
|
25 |
|
@@ -81,6 +67,23 @@ def transcribe(audio):
|
|
81 |
|
82 |
return chat_transcript,'output.wav'
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
# Define the Gradio UI interface
|
85 |
# ui = gr.Interface(fn=transcribe, inputs=gr.Audio(source="microphone", type="filepath"), outputs="text")
|
86 |
ui = gr.Interface(fn=transcribe, inputs=gr.Audio(source="microphone", type="filepath"), outputs=['text','audio'])
|
|
|
6 |
|
7 |
openai.api_key = os.environ.get('OPENAI_API_KEY')
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
messages = [{"role": "system", "content": 'You are Steve Jobs. Respond to all input in 25 words or less.'}]
|
11 |
|
|
|
67 |
|
68 |
return chat_transcript,'output.wav'
|
69 |
|
70 |
+
css = """
|
71 |
+
#col-container {max-width: 80%; margin-left: auto; margin-right: auto;}
|
72 |
+
#header {text-align: center;}
|
73 |
+
}
|
74 |
+
"""
|
75 |
+
|
76 |
+
with gr.Blocks(css=css) as ui:
|
77 |
+
|
78 |
+
state = gr.State(get_empty_state())
|
79 |
+
|
80 |
+
with gr.Column(elem_id="col-container"):
|
81 |
+
gr.Markdown("""## Talk to AI Steve Jobs: Audio-to-Text+Audio generation
|
82 |
+
Powered by ChatGPT + Whisper + ElevenLabs + HuggingFace <br>
|
83 |
+
<br>
|
84 |
+
""",
|
85 |
+
elem_id="header")
|
86 |
+
|
87 |
# Define the Gradio UI interface
|
88 |
# ui = gr.Interface(fn=transcribe, inputs=gr.Audio(source="microphone", type="filepath"), outputs="text")
|
89 |
ui = gr.Interface(fn=transcribe, inputs=gr.Audio(source="microphone", type="filepath"), outputs=['text','audio'])
|