Spaces:
Running
Running
Add Authorization header to API configuration for improved security
Browse files- config/settings.py +3 -2
config/settings.py
CHANGED
|
@@ -9,11 +9,12 @@ if not HF_TOKEN:
|
|
| 9 |
API_CONFIG = {
|
| 10 |
"inference_endpoint": os.getenv("HF_INFERENCE_ENDPOINT", "https://api-inference.huggingface.co"),
|
| 11 |
"token": HF_TOKEN,
|
| 12 |
-
"is_paid_tier": True,
|
| 13 |
"timeout": 30,
|
| 14 |
"headers": {
|
| 15 |
"X-Use-Cache": "false",
|
| 16 |
-
"Content-Type": "application/json"
|
|
|
|
| 17 |
}
|
| 18 |
}
|
| 19 |
|
|
|
|
| 9 |
API_CONFIG = {
|
| 10 |
"inference_endpoint": os.getenv("HF_INFERENCE_ENDPOINT", "https://api-inference.huggingface.co"),
|
| 11 |
"token": HF_TOKEN,
|
| 12 |
+
"is_paid_tier": True,
|
| 13 |
"timeout": 30,
|
| 14 |
"headers": {
|
| 15 |
"X-Use-Cache": "false",
|
| 16 |
+
"Content-Type": "application/json",
|
| 17 |
+
"Authorization": f"Bearer {HF_TOKEN}" # явно указываем авторизацию
|
| 18 |
}
|
| 19 |
}
|
| 20 |
|