Spaces:
Running
Running
Safwanahmad619
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -54,12 +54,18 @@
|
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
# Load Whisper model
|
65 |
model = whisper.load_model("base") # You can also use "small", "medium", "large"
|
|
|
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_API_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") # You can also use "small", "medium", "large"
|