sushantvyz commited on
Commit
22eb0d1
·
verified ·
1 Parent(s): 65bcfb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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
- # NEW ENDPOINT - This is the fix!
30
- API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.2/v1/chat/completions"
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 NEW endpoint\n✅ Calling API...\n\n"
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