khurrameycon commited on
Commit
4c2b726
·
verified ·
1 Parent(s): e1d21ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -34,7 +34,7 @@ def llm_chat_response(text: str) -> str:
34
  raise HTTPException(status_code=500, detail="HF_TOKEN not configured")
35
 
36
  logger.info("Initializing InferenceClient...")
37
- client = InferenceClient(api_key=HF_TOKEN)
38
 
39
  messages = [
40
  {
@@ -76,7 +76,6 @@ async def chat(request: ChatRequest):
76
  async def root():
77
  return {"message": "Welcome to the LLM Chat API. Use POST /chat endpoint to get responses."}
78
 
79
- # Fixed error handlers
80
  @app.exception_handler(404)
81
  async def not_found_handler(request, exc):
82
  return JSONResponse(
 
34
  raise HTTPException(status_code=500, detail="HF_TOKEN not configured")
35
 
36
  logger.info("Initializing InferenceClient...")
37
+ client = InferenceClient(token=HF_TOKEN) # Changed from api_key to token
38
 
39
  messages = [
40
  {
 
76
  async def root():
77
  return {"message": "Welcome to the LLM Chat API. Use POST /chat endpoint to get responses."}
78
 
 
79
  @app.exception_handler(404)
80
  async def not_found_handler(request, exc):
81
  return JSONResponse(