iamkdp commited on
Commit
10359d9
·
verified ·
1 Parent(s): 7588986

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,11 +1,12 @@
1
  import gradio as gr
 
2
  import requests
3
  from cachetools import TTLCache
4
 
5
  # Configuration
6
  API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.3"
7
- API_TOKEN = "hf_yourtokenhere" # Replace with your token
8
- MAX_TOKENS = 256
9
  CACHE_TTL = 3600 # 1 hour cache
10
 
11
  # Initialize response cache
 
1
  import gradio as gr
2
+ import os
3
  import requests
4
  from cachetools import TTLCache
5
 
6
  # Configuration
7
  API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.3"
8
+ API_TOKEN = os.environ.get("HF_TOKEN") # Get from environment # Replace with your token
9
+ MAX_TOKENS = 150
10
  CACHE_TTL = 3600 # 1 hour cache
11
 
12
  # Initialize response cache