Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,10 @@ def giveVoice(bot_message):
|
|
38 |
|
39 |
return new_path
|
40 |
|
|
|
|
|
41 |
|
|
|
42 |
|
43 |
|
44 |
|
@@ -46,15 +49,16 @@ with gr.Blocks() as demo:
|
|
46 |
with gr.Row():
|
47 |
with gr.Column():
|
48 |
user_audio = gr.Audio(source="microphone", type="filepath", label="Input Phrase")
|
49 |
-
submit_btn = gr.Button(value="Transcribe")
|
|
|
50 |
with gr.Column():
|
51 |
-
#gpt_response = gr.Audio(label="Voice Response")
|
52 |
user_transcript = gr.Text(label="User Transcript")
|
53 |
gpt_transcript = gr.Text(label="GPT Transcript")
|
54 |
gpt_voice = gr.Audio(label="Voice Response")
|
55 |
submit_btn.click(transcribe, inputs=user_audio, outputs=user_transcript)
|
56 |
user_transcript.change(botResponse, inputs=user_transcript, outputs=gpt_transcript)
|
57 |
gpt_transcript.change(giveVoice, inputs=gpt_transcript, outputs=gpt_voice)
|
|
|
58 |
|
59 |
|
60 |
|
|
|
38 |
|
39 |
return new_path
|
40 |
|
41 |
+
def keepLog(user, gpt):
|
42 |
+
chat_log = user + " : " gpt
|
43 |
|
44 |
+
return chat_log
|
45 |
|
46 |
|
47 |
|
|
|
49 |
with gr.Row():
|
50 |
with gr.Column():
|
51 |
user_audio = gr.Audio(source="microphone", type="filepath", label="Input Phrase")
|
52 |
+
submit_btn = gr.Button(value="Transcribe")
|
53 |
+
chat_log = gr.Text(label="Chat Log")
|
54 |
with gr.Column():
|
|
|
55 |
user_transcript = gr.Text(label="User Transcript")
|
56 |
gpt_transcript = gr.Text(label="GPT Transcript")
|
57 |
gpt_voice = gr.Audio(label="Voice Response")
|
58 |
submit_btn.click(transcribe, inputs=user_audio, outputs=user_transcript)
|
59 |
user_transcript.change(botResponse, inputs=user_transcript, outputs=gpt_transcript)
|
60 |
gpt_transcript.change(giveVoice, inputs=gpt_transcript, outputs=gpt_voice)
|
61 |
+
gpt_voice.change(keepLog, inputs=[user_transcript, gpt_transcript], outputs=gpt_voice)
|
62 |
|
63 |
|
64 |
|