Spaces:
Running
Running
github-actions[bot] commited on
Commit ·
24ef548
1
Parent(s): 9ea3d39
🚀 Auto-deploy from GitHub (798f389)
Browse files
main.py
CHANGED
|
@@ -237,6 +237,7 @@ def get_client() -> InferenceClient:
|
|
| 237 |
_zsc_client = InferenceClient(
|
| 238 |
token=HF_TOKEN,
|
| 239 |
timeout=60,
|
|
|
|
| 240 |
)
|
| 241 |
logger.info("HF InferenceClient initialized (for zero-shot classification)")
|
| 242 |
break
|
|
@@ -271,7 +272,7 @@ def call_hf_chat(
|
|
| 271 |
raise RuntimeError("HF_TOKEN is not set")
|
| 272 |
|
| 273 |
target_model = model or HF_MATH_MODEL_ID
|
| 274 |
-
url = f"https://
|
| 275 |
headers = {
|
| 276 |
"Authorization": f"Bearer {HF_TOKEN}",
|
| 277 |
"Content-Type": "application/json",
|
|
@@ -336,7 +337,7 @@ def call_math_tutor_llm(question: str) -> str:
|
|
| 336 |
if not HF_TOKEN:
|
| 337 |
raise RuntimeError("HF_TOKEN is not set")
|
| 338 |
|
| 339 |
-
url = f"https://
|
| 340 |
payload = {
|
| 341 |
"inputs": build_math_tutor_prompt(question),
|
| 342 |
"parameters": {
|
|
|
|
| 237 |
_zsc_client = InferenceClient(
|
| 238 |
token=HF_TOKEN,
|
| 239 |
timeout=60,
|
| 240 |
+
api_url="https://router.huggingface.co/hf-inference",
|
| 241 |
)
|
| 242 |
logger.info("HF InferenceClient initialized (for zero-shot classification)")
|
| 243 |
break
|
|
|
|
| 272 |
raise RuntimeError("HF_TOKEN is not set")
|
| 273 |
|
| 274 |
target_model = model or HF_MATH_MODEL_ID
|
| 275 |
+
url = f"https://router.huggingface.co/hf-inference/models/{target_model}/v1/chat/completions"
|
| 276 |
headers = {
|
| 277 |
"Authorization": f"Bearer {HF_TOKEN}",
|
| 278 |
"Content-Type": "application/json",
|
|
|
|
| 337 |
if not HF_TOKEN:
|
| 338 |
raise RuntimeError("HF_TOKEN is not set")
|
| 339 |
|
| 340 |
+
url = f"https://router.huggingface.co/hf-inference/models/{HF_MATH_MODEL_ID}"
|
| 341 |
payload = {
|
| 342 |
"inputs": build_math_tutor_prompt(question),
|
| 343 |
"parameters": {
|