Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,8 +26,8 @@ def simple_test(user_text):
|
|
| 26 |
|
| 27 |
# Step 5: Try calling the API with NEW endpoint
|
| 28 |
try:
|
| 29 |
-
#
|
| 30 |
-
API_URL = "https://
|
| 31 |
|
| 32 |
headers = {
|
| 33 |
"Authorization": f"Bearer {HF_TOKEN}",
|
|
@@ -45,7 +45,7 @@ def simple_test(user_text):
|
|
| 45 |
}
|
| 46 |
|
| 47 |
# Show we're about to make the call
|
| 48 |
-
status_msg = f"✅ Token found: {token_preview}\n✅ Using
|
| 49 |
|
| 50 |
response = requests.post(API_URL, headers=headers, json=payload, timeout=30)
|
| 51 |
|
|
|
|
| 26 |
|
| 27 |
# Step 5: Try calling the API with NEW endpoint
|
| 28 |
try:
|
| 29 |
+
# CORRECT ENDPOINT - Using router.huggingface.co
|
| 30 |
+
API_URL = "https://router.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.2/v1/chat/completions"
|
| 31 |
|
| 32 |
headers = {
|
| 33 |
"Authorization": f"Bearer {HF_TOKEN}",
|
|
|
|
| 45 |
}
|
| 46 |
|
| 47 |
# Show we're about to make the call
|
| 48 |
+
status_msg = f"✅ Token found: {token_preview}\n✅ Using ROUTER endpoint (router.huggingface.co)\n✅ Calling API...\n\n"
|
| 49 |
|
| 50 |
response = requests.post(API_URL, headers=headers, json=payload, timeout=30)
|
| 51 |
|