iamkdp commited on
Commit
9d44979
·
verified ·
1 Parent(s): a3630d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -9,6 +9,10 @@ API_TOKEN = os.environ.get("HF_TOKEN") # Get from environment # Replace with yo
9
  MAX_TOKENS = 150
10
  CACHE_TTL = 3600 # 1 hour cache
11
 
 
 
 
 
12
  # Initialize response cache
13
  response_cache = TTLCache(maxsize=100, ttl=CACHE_TTL)
14
 
 
9
  MAX_TOKENS = 150
10
  CACHE_TTL = 3600 # 1 hour cache
11
 
12
+ #Validate API key
13
+ if not API_TOKEN:
14
+ raise gr.Error("API_KEY environment variable not set!")
15
+
16
  # Initialize response cache
17
  response_cache = TTLCache(maxsize=100, ttl=CACHE_TTL)
18