alamanna commited on
Commit
900fdfe
·
verified ·
1 Parent(s): 70e07e3

Update app.py

Browse files

Added max_input_tokens=20000 and max_new_tokens=512

Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -19,11 +19,15 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
19
  class BasicAgent:
20
  def __init__(self):
21
  print("BasicAgent initialized.")
22
- model = InferenceClientModel(token=hf_token)
 
 
 
 
23
  self.agent = CodeAgent(
24
  tools=[DuckDuckGoSearchTool(), suggest_outfit, define_coordinates, get_weather],
25
  model=model
26
- )
27
 
28
  def __call__(self, question: str) -> str:
29
  print(f"Agent received question (first 50 chars): {question[:50]}...")
 
19
  class BasicAgent:
20
  def __init__(self):
21
  print("BasicAgent initialized.")
22
+ model = InferenceClientModel(
23
+ token=hf_token,
24
+ max_input_tokens=20000, # new: limit total tokens
25
+ max_new_tokens=512 # still allow enough answer length
26
+ )
27
  self.agent = CodeAgent(
28
  tools=[DuckDuckGoSearchTool(), suggest_outfit, define_coordinates, get_weather],
29
  model=model
30
+ )
31
 
32
  def __call__(self, question: str) -> str:
33
  print(f"Agent received question (first 50 chars): {question[:50]}...")