Update app.py
Browse files
app.py
CHANGED
@@ -138,13 +138,6 @@ def transcribe(audio, text):
|
|
138 |
return colorized_system_message
|
139 |
|
140 |
|
141 |
-
# Define the input and output components for Gradio
|
142 |
-
audio_input = Audio(source="microphone", type="filepath", label="Record your message")
|
143 |
-
text_input = Textbox(label="Type your message", max_length=4096)
|
144 |
-
output_text = gr.outputs.Textbox(label="Response")
|
145 |
-
output_audio = Audio()
|
146 |
-
|
147 |
-
|
148 |
def colorize_text(text):
|
149 |
doc = nlp(text)
|
150 |
colorized_text = ""
|
@@ -160,13 +153,16 @@ def colorize_text(text):
|
|
160 |
return colorized_text
|
161 |
|
162 |
|
|
|
|
|
|
|
|
|
163 |
|
164 |
# Define the Gradio interface
|
165 |
iface = gr.Interface(
|
166 |
fn=transcribe,
|
167 |
inputs=[audio_input, text_input],
|
168 |
outputs=[output_text],
|
169 |
-
output_text = gr.outputs.HTML(label="Response"),
|
170 |
title="Hold On, Pain Ends (HOPE)",
|
171 |
description="Talk to Your USMLE Tutor HOPE",
|
172 |
theme="compact",
|
|
|
138 |
return colorized_system_message
|
139 |
|
140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
def colorize_text(text):
|
142 |
doc = nlp(text)
|
143 |
colorized_text = ""
|
|
|
153 |
return colorized_text
|
154 |
|
155 |
|
156 |
+
# Define the input and output components for Gradio
|
157 |
+
audio_input = Audio(source="microphone", type="filepath", label="Record your message")
|
158 |
+
text_input = Textbox(label="Type your message", max_length=4096)
|
159 |
+
output_text = Markdown()
|
160 |
|
161 |
# Define the Gradio interface
|
162 |
iface = gr.Interface(
|
163 |
fn=transcribe,
|
164 |
inputs=[audio_input, text_input],
|
165 |
outputs=[output_text],
|
|
|
166 |
title="Hold On, Pain Ends (HOPE)",
|
167 |
description="Talk to Your USMLE Tutor HOPE",
|
168 |
theme="compact",
|