Safwanahmad619 commited on
Commit
0bb7775
·
verified ·
1 Parent(s): 482e48f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
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
- 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"
 
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"