Update app.py
Browse files
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 = "
|
| 8 |
-
MAX_TOKENS =
|
| 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
|