Freate16 commited on
Commit
45913a7
·
1 Parent(s): a823011

Added timeout to LLM API

Browse files
Files changed (1) hide show
  1. chatbot/agentic_rag/agent.py +1 -0
chatbot/agentic_rag/agent.py CHANGED
@@ -108,6 +108,7 @@ def run_reasoning_agent(question: str, max_steps: int = 8):
108
  model="Qwen/Qwen3-4B-Instruct-2507",
109
  max_tokens=1024,
110
  temperature=0.1,
 
111
  stop=["Observation:", "Observation"]
112
  )
113
  except Exception as e:
 
108
  model="Qwen/Qwen3-4B-Instruct-2507",
109
  max_tokens=1024,
110
  temperature=0.1,
111
+ timeout=30, # Prevent infinite hanging if Hugging Face is slow
112
  stop=["Observation:", "Observation"]
113
  )
114
  except Exception as e: