Spaces:
Sleeping
Sleeping
| import os | |
| from groq import Groq | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| GROQ_API_KEY = os.getenv("GROQ_API_KEY") | |
| def transcribe_audio(audio_filepath, stt_model='whisper-large-v3'): | |
| client = Groq(api_key=GROQ_API_KEY) | |
| with open(audio_filepath, "rb") as audio_file: | |
| transcription = client.audio.transcriptions.create( | |
| model=stt_model, | |
| file=audio_file, | |
| language="en" | |
| ) | |
| return transcription.text | |