Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def transcribe_audio(audio, openai_api_key):
|
|
58 |
|
59 |
try:
|
60 |
# Open the audio file and pass it as a file object
|
61 |
-
with open(audio
|
62 |
audio_file_content = audio_file.read()
|
63 |
|
64 |
# Use the correct transcription API call
|
@@ -264,7 +264,7 @@ def create_interface():
|
|
264 |
with gr.Row():
|
265 |
image_input = gr.Image(label="Upload an Image", type="pil") # Image upload input
|
266 |
input_text = gr.Textbox(label="Enter Text Question", placeholder="Ask a question or provide text", lines=2)
|
267 |
-
audio_input = gr.Audio(label="Upload or Record Audio", type="
|
268 |
|
269 |
with gr.Row():
|
270 |
reasoning_effort = gr.Dropdown(
|
|
|
58 |
|
59 |
try:
|
60 |
# Open the audio file and pass it as a file object
|
61 |
+
with open(audio, 'rb') as audio_file:
|
62 |
audio_file_content = audio_file.read()
|
63 |
|
64 |
# Use the correct transcription API call
|
|
|
264 |
with gr.Row():
|
265 |
image_input = gr.Image(label="Upload an Image", type="pil") # Image upload input
|
266 |
input_text = gr.Textbox(label="Enter Text Question", placeholder="Ask a question or provide text", lines=2)
|
267 |
+
audio_input = gr.Audio(label="Upload or Record Audio", type="filepath") # Audio upload or record input (using filepath)
|
268 |
|
269 |
with gr.Row():
|
270 |
reasoning_effort = gr.Dropdown(
|