Waseem7711 commited on
Commit
5770529
·
verified ·
1 Parent(s): ecbac4d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -7,10 +7,9 @@ import numpy as np
7
  import soundfile as sf
8
  import logging
9
 
10
-
11
- # initilize the Groq API
12
-
13
  GROQ_API_KEY = "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"
 
14
  # Configure logging
15
  logging.basicConfig(level=logging.DEBUG)
16
 
@@ -24,7 +23,7 @@ except Exception as e:
24
  # Initialize Groq client (API key required for Groq API)
25
  try:
26
  client = Groq(
27
- api_key=os.environ.get("GROQ_API_KEY"), # Ensure your Groq API key is set as an environment variable
28
  )
29
  logging.info("Groq client initialized successfully.")
30
  except Exception as e:
@@ -138,4 +137,4 @@ iface = gr.Interface(
138
  try:
139
  iface.launch()
140
  except Exception as e:
141
- logging.error(f"Error launching Gradio interface: {e}")
 
7
  import soundfile as sf
8
  import logging
9
 
10
+ # Initialize the Groq API key
 
 
11
  GROQ_API_KEY = "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"
12
+
13
  # Configure logging
14
  logging.basicConfig(level=logging.DEBUG)
15
 
 
23
  # Initialize Groq client (API key required for Groq API)
24
  try:
25
  client = Groq(
26
+ api_key=GROQ_API_KEY # Directly use the API key from the variable
27
  )
28
  logging.info("Groq client initialized successfully.")
29
  except Exception as e:
 
137
  try:
138
  iface.launch()
139
  except Exception as e:
140
+ logging.error(f"Error launching Gradio interface: {e}")