anamjafar6 commited on
Commit
3efcc38
·
verified ·
1 Parent(s): 1dd36f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -11
app.py CHANGED
@@ -12,22 +12,12 @@ try:
12
  except ImportError:
13
  Groq = None
14
 
15
- # Read the API key from Hugging Face Secrets
16
- GROQ_API_KEY = os.environ.get("GROQ_API_KEY")
17
-
18
- # Safety check – show status in the app (never show actual key!)
19
- if GROQ_API_KEY:
20
- st.sidebar.success("✅ GROQ API Key found")
21
- else:
22
- st.sidebar.error("❌ GROQ API Key missing! Please set it in Hugging Face Spaces -> Settings -> Repository Secrets")
23
-
24
-
25
  # -----------------------------
26
  # Utility Functions
27
  # -----------------------------
28
  def load_api_key() -> str:
29
  """Load the GROQ API key from Hugging Face secrets or env vars."""
30
- api_key = os.getenv("GROQ_API_KEY")
31
  if not api_key:
32
  try:
33
  from huggingface_hub import HfFolder
 
12
  except ImportError:
13
  Groq = None
14
 
 
 
 
 
 
 
 
 
 
 
15
  # -----------------------------
16
  # Utility Functions
17
  # -----------------------------
18
  def load_api_key() -> str:
19
  """Load the GROQ API key from Hugging Face secrets or env vars."""
20
+ api_key = os.environ.get("GROQ_API_KEY")
21
  if not api_key:
22
  try:
23
  from huggingface_hub import HfFolder