Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -232,7 +232,7 @@ def retry_with_exponential_backoff(max_tries=MAX_RETRIES, initial_wait=INITIAL_W
|
|
232 |
@retry_with_exponential_backoff()
|
233 |
def transcribe_audio_with_groq(audio_data) -> str:
|
234 |
"""
|
235 |
-
Transcribe audio file using Groq's
|
236 |
|
237 |
Args:
|
238 |
audio_data: Either file path string or binary audio data
|
@@ -267,11 +267,12 @@ def transcribe_audio_with_groq(audio_data) -> str:
|
|
267 |
with open(audio_file_path, "rb") as file:
|
268 |
# Display a progress message since transcription can take time
|
269 |
progress_placeholder = st.empty()
|
270 |
-
progress_placeholder.info("Processing audio
|
271 |
|
|
|
272 |
transcription = st.session_state.groq_client.audio.transcriptions.create(
|
273 |
file=(audio_file_path, file.read()),
|
274 |
-
model=
|
275 |
response_format="verbose_json"
|
276 |
)
|
277 |
|
@@ -303,6 +304,7 @@ def transcribe_audio_with_groq(audio_data) -> str:
|
|
303 |
# Re-raise as a GroqAPIError for consistent handling
|
304 |
raise GroqAPIError(f"Error transcribing audio: {error_msg}")
|
305 |
|
|
|
306 |
def process_transcript(transcript):
|
307 |
"""Process transcript with Groq's DeepSeek model for highly structured notes"""
|
308 |
if not st.session_state.groq_client:
|
|
|
232 |
@retry_with_exponential_backoff()
|
233 |
def transcribe_audio_with_groq(audio_data) -> str:
|
234 |
"""
|
235 |
+
Transcribe audio file using Groq's whisper-large-v3-turbo model
|
236 |
|
237 |
Args:
|
238 |
audio_data: Either file path string or binary audio data
|
|
|
267 |
with open(audio_file_path, "rb") as file:
|
268 |
# Display a progress message since transcription can take time
|
269 |
progress_placeholder = st.empty()
|
270 |
+
progress_placeholder.info("Processing audio with whisper-large-v3-turbo...")
|
271 |
|
272 |
+
# Use the whisper-large-v3-turbo model as requested
|
273 |
transcription = st.session_state.groq_client.audio.transcriptions.create(
|
274 |
file=(audio_file_path, file.read()),
|
275 |
+
model="whisper-large-v3-turbo",
|
276 |
response_format="verbose_json"
|
277 |
)
|
278 |
|
|
|
304 |
# Re-raise as a GroqAPIError for consistent handling
|
305 |
raise GroqAPIError(f"Error transcribing audio: {error_msg}")
|
306 |
|
307 |
+
|
308 |
def process_transcript(transcript):
|
309 |
"""Process transcript with Groq's DeepSeek model for highly structured notes"""
|
310 |
if not st.session_state.groq_client:
|