ApeMaster commited on
Commit
45ce5bb
·
verified ·
1 Parent(s): 93e36e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -231,18 +231,21 @@ def browse_webpage(url: str) -> str:
231
  final_answer = FinalAnswerTool()
232
 
233
  # ---------------------------------------------------------------------------
234
- # Model — works with both InferenceClientModel (new) and HfApiModel (old)
235
- # provider="together" is REQUIRED — otherwise the router doesn't know where to send requests
236
- # ---------------------------------------------------------------------------
237
- # ---------------------------------------------------------------------------
238
- # Model — Llama-3.3-70B with anti-repetition settings
 
 
239
  # ---------------------------------------------------------------------------
240
  model = HFModel(
241
  model_id="meta-llama/Llama-3.3-70B-Instruct",
242
  provider="together",
243
  max_tokens=4096,
244
  temperature=0.7,
245
- repetition_penalty=1.1,
 
246
  )
247
 
248
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
 
231
  final_answer = FinalAnswerTool()
232
 
233
  # ---------------------------------------------------------------------------
234
+ # Model — Llama-3.3-70B via Together AI
235
+ #
236
+ # NOTE on anti-repetition parameters:
237
+ # - `repetition_penalty` is NOT supported by the OpenAI-compatible chat
238
+ # completions endpoint that HF Inference Providers use. It raises:
239
+ # "InferenceClient.chat_completion() got an unexpected keyword argument"
240
+ # - Use `frequency_penalty` / `presence_penalty` instead (range -2.0..2.0).
241
  # ---------------------------------------------------------------------------
242
  model = HFModel(
243
  model_id="meta-llama/Llama-3.3-70B-Instruct",
244
  provider="together",
245
  max_tokens=4096,
246
  temperature=0.7,
247
+ frequency_penalty=0.3,
248
+ presence_penalty=0.1,
249
  )
250
 
251
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)