Update app.py
Browse files
app.py
CHANGED
|
@@ -49,9 +49,9 @@ def generate_speech(name, input_text):
|
|
| 49 |
for i, msg in enumerate(history_openai_format):
|
| 50 |
if msg['role'] != 'system':
|
| 51 |
if msg['role'] == 'user':
|
| 52 |
-
transcript += f"Guest: {input_text}\n
|
| 53 |
else:
|
| 54 |
-
transcript += f"Johnny: {msg['content']}\n\n
|
| 55 |
|
| 56 |
# Return the binary audio data and the transcript
|
| 57 |
return response.content, transcript
|
|
@@ -63,7 +63,7 @@ iface = gr.Interface(
|
|
| 63 |
gr.Textbox(label="Your Name (required):", placeholder="Enter your FIRST NAME"),
|
| 64 |
gr.Textbox(label="Your question or comment for Johnny:")
|
| 65 |
],
|
| 66 |
-
outputs=[gr.Audio(autoplay=True), gr.TextArea(label="Transcript")],
|
| 67 |
live=False
|
| 68 |
)
|
| 69 |
|
|
|
|
| 49 |
for i, msg in enumerate(history_openai_format):
|
| 50 |
if msg['role'] != 'system':
|
| 51 |
if msg['role'] == 'user':
|
| 52 |
+
transcript += f"Guest: {input_text}\n" # Change 'User' to 'Guest'
|
| 53 |
else:
|
| 54 |
+
transcript += f"Johnny: {msg['content']}\n\n" # Change 'Assistant' to 'Johnny'
|
| 55 |
|
| 56 |
# Return the binary audio data and the transcript
|
| 57 |
return response.content, transcript
|
|
|
|
| 63 |
gr.Textbox(label="Your Name (required):", placeholder="Enter your FIRST NAME"),
|
| 64 |
gr.Textbox(label="Your question or comment for Johnny:")
|
| 65 |
],
|
| 66 |
+
outputs=[gr.Audio(autoplay=True), gr.TextArea(label="Transcript", autoscroll="True")],
|
| 67 |
live=False
|
| 68 |
)
|
| 69 |
|