Spaces:
Sleeping
Sleeping
Safwanahmad619
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -54,21 +54,15 @@
|
|
54 |
# )
|
55 |
|
56 |
# iface.launch()
|
|
|
57 |
import os
|
58 |
import gradio as gr
|
59 |
-
import whisper
|
60 |
from gtts import gTTS
|
61 |
-
from anthropic import Anthropic # Import the Anthropic client
|
62 |
import io # Import io for BytesIO
|
63 |
-
|
64 |
-
# Get the Anthropic API key from environment variables
|
65 |
-
ANTHROPIC_API_KEY = os.getenv("anthropic_key")
|
66 |
-
if not ANTHROPIC_API_KEY:
|
67 |
-
raise ValueError("ANTHROPIC_API_KEY environment variable is not set.")
|
68 |
-
client = Anthropic(api_key=ANTHROPIC_API_KEY) # Initialize the Anthropic client
|
69 |
|
70 |
# Load Whisper model
|
71 |
-
model = whisper.load_model("base")
|
72 |
|
73 |
def chatbot(audio=None):
|
74 |
try:
|
|
|
54 |
# )
|
55 |
|
56 |
# iface.launch()
|
57 |
+
|
58 |
import os
|
59 |
import gradio as gr
|
|
|
60 |
from gtts import gTTS
|
|
|
61 |
import io # Import io for BytesIO
|
62 |
+
import whisper # Import the Whisper model from OpenAI
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
# Load Whisper model
|
65 |
+
model = whisper.load_model("base") # You can also use "small", "medium", "large"
|
66 |
|
67 |
def chatbot(audio=None):
|
68 |
try:
|