Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,12 +4,15 @@ import whisper
|
|
| 4 |
from gtts import gTTS
|
| 5 |
from groq import Groq
|
| 6 |
import numpy as np
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# Initialize Whisper and Groq
|
| 11 |
whisper_model = whisper.load_model("base")
|
| 12 |
-
client = Groq(api_key=
|
| 13 |
|
| 14 |
def chatbot(audio_input):
|
| 15 |
try:
|
|
@@ -67,4 +70,5 @@ interface = gr.Interface(
|
|
| 67 |
)
|
| 68 |
|
| 69 |
# Launch the Gradio app
|
| 70 |
-
|
|
|
|
|
|
| 4 |
from gtts import gTTS
|
| 5 |
from groq import Groq
|
| 6 |
import numpy as np
|
| 7 |
+
|
| 8 |
+
# Set your Groq API key
|
| 9 |
+
api_key = os.getenv('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')
|
| 10 |
+
if not api_key:
|
| 11 |
+
raise ValueError("GROQ_API_KEY environment variable not set")
|
| 12 |
|
| 13 |
# Initialize Whisper and Groq
|
| 14 |
whisper_model = whisper.load_model("base")
|
| 15 |
+
client = Groq(api_key=api_key)
|
| 16 |
|
| 17 |
def chatbot(audio_input):
|
| 18 |
try:
|
|
|
|
| 70 |
)
|
| 71 |
|
| 72 |
# Launch the Gradio app
|
| 73 |
+
if __name__ == "__main__":
|
| 74 |
+
interface.launch()
|