2Btainment commited on
Commit
c191ef7
·
verified ·
1 Parent(s): afa34e6

P7.3 LLM-Fallback mit Nutzer-Token

Browse files
Files changed (1) hide show
  1. server/main.py +1 -1
server/main.py CHANGED
@@ -464,7 +464,7 @@ async def llm_ep(req: Request, prompt: str = Form(...), system: str = Form(""),
464
  try:
465
  from gradio_client import Client
466
  def g():
467
- c = Client("huggingface-projects/llama-3.2-3B-Instruct", verbose=False)
468
  return c.predict((system + "\n\n" if system else "") + prompt, min(mt, 2048), 0.3, 0.9, 50, 1.1, api_name="/generate")
469
  out = await asyncio.to_thread(g)
470
  return {"text": out if isinstance(out, str) else json.dumps(out), "model": "huggingface-projects/llama-3.2-3B-Instruct", "note": err}
 
464
  try:
465
  from gradio_client import Client
466
  def g():
467
+ c = Client("huggingface-projects/llama-3.2-3B-Instruct", hf_token=(s or {}).get("token"), verbose=False)
468
  return c.predict((system + "\n\n" if system else "") + prompt, min(mt, 2048), 0.3, 0.9, 50, 1.1, api_name="/generate")
469
  out = await asyncio.to_thread(g)
470
  return {"text": out if isinstance(out, str) else json.dumps(out), "model": "huggingface-projects/llama-3.2-3B-Instruct", "note": err}