Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,6 @@ import uuid
|
|
| 9 |
# Constants
|
| 10 |
MODEL_NAME = "llama3-70b-8192"
|
| 11 |
|
| 12 |
-
|
| 13 |
# Load Whisper model once
|
| 14 |
whisper_model = whisper.load_model("base")
|
| 15 |
|
|
@@ -19,6 +18,10 @@ def process_audio(audio_filepath):
|
|
| 19 |
user_input = result["text"]
|
| 20 |
|
| 21 |
# Step 2: Get response from Groq
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
client = Groq(api_key=GROQ_API_KEY)
|
| 23 |
chat_completion = client.chat.completions.create(
|
| 24 |
messages=[{"role": "user", "content": user_input}],
|
|
|
|
| 9 |
# Constants
|
| 10 |
MODEL_NAME = "llama3-70b-8192"
|
| 11 |
|
|
|
|
| 12 |
# Load Whisper model once
|
| 13 |
whisper_model = whisper.load_model("base")
|
| 14 |
|
|
|
|
| 18 |
user_input = result["text"]
|
| 19 |
|
| 20 |
# Step 2: Get response from Groq
|
| 21 |
+
GROQ_API_KEY = os.environ.get("GROQ_API_KEY")
|
| 22 |
+
if not GROQ_API_KEY:
|
| 23 |
+
raise ValueError("❌ GROQ_API_KEY not found. Please set it in Hugging Face Secrets.")
|
| 24 |
+
|
| 25 |
client = Groq(api_key=GROQ_API_KEY)
|
| 26 |
chat_completion = client.chat.completions.create(
|
| 27 |
messages=[{"role": "user", "content": user_input}],
|