Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,8 +43,7 @@ with gr.Blocks() as demo:
|
|
| 43 |
# First message as instructions to OpenAI
|
| 44 |
# Establishes a State object to create a
|
| 45 |
# unique state for each user and on reload
|
| 46 |
-
messages = gr.State(value=[{"role": "system", "content": "Return the following text verbatim, with one change: Put bold markdown markup (**) around a few of the central ideas in the text. Follow the text with a short bulleted summary of the text, in the first person.
|
| 47 |
-
"}])
|
| 48 |
|
| 49 |
# Takes the users transcribed audio as a string
|
| 50 |
# Takes the messages list as a reference
|
|
@@ -99,14 +98,14 @@ with gr.Blocks() as demo:
|
|
| 99 |
# component as input/output
|
| 100 |
with gr.Row():
|
| 101 |
with gr.Column(scale=1):
|
| 102 |
-
user_audio = gr.Audio(source="microphone", type="filepath", label="
|
| 103 |
submit_btn = gr.Button(value="Transcribe Audio")
|
| 104 |
submit_btn2 = gr.Button(value="Submit Text")
|
| 105 |
-
|
| 106 |
with gr.Column(scale=2):
|
| 107 |
-
user_transcript = gr.Text(label="
|
| 108 |
user_text = gr.Text(label="Text Input")
|
| 109 |
-
gpt_transcript = gr.Text(label="
|
| 110 |
submit_btn.click(transcribe, user_audio, user_transcript)
|
| 111 |
submit_btn2.click(botResponse, [user_text, messages], gpt_transcript)
|
| 112 |
user_transcript.change(botResponse, [user_transcript, messages], gpt_transcript)
|
|
|
|
| 43 |
# First message as instructions to OpenAI
|
| 44 |
# Establishes a State object to create a
|
| 45 |
# unique state for each user and on reload
|
| 46 |
+
messages = gr.State(value=[{"role": "system", "content": "Return the following text verbatim, with one change: Put bold markdown markup (**) around a few of the central ideas in the text. Follow the text with a short bulleted summary of the text, in the first person."}])
|
|
|
|
| 47 |
|
| 48 |
# Takes the users transcribed audio as a string
|
| 49 |
# Takes the messages list as a reference
|
|
|
|
| 98 |
# component as input/output
|
| 99 |
with gr.Row():
|
| 100 |
with gr.Column(scale=1):
|
| 101 |
+
user_audio = gr.Audio(source="microphone", type="filepath", label="Record reflection")
|
| 102 |
submit_btn = gr.Button(value="Transcribe Audio")
|
| 103 |
submit_btn2 = gr.Button(value="Submit Text")
|
| 104 |
+
# gpt_voice = gr.Audio(label="Play Voice")
|
| 105 |
with gr.Column(scale=2):
|
| 106 |
+
user_transcript = gr.Text(label="Transcription", interactive=False)
|
| 107 |
user_text = gr.Text(label="Text Input")
|
| 108 |
+
gpt_transcript = gr.Text(label="With main points highlighted and final summary.")
|
| 109 |
submit_btn.click(transcribe, user_audio, user_transcript)
|
| 110 |
submit_btn2.click(botResponse, [user_text, messages], gpt_transcript)
|
| 111 |
user_transcript.change(botResponse, [user_transcript, messages], gpt_transcript)
|