Update app.py
Browse files230 unmodified lines231232233234235236237238239240241242243244245246247248230 unmodified linesfinal_answer = FinalAnswerTool()# ---------------------------------------------------------------------------# Model — works with both InferenceClientModel (new) and HfApiModel (old)# provider="together" is REQUIRED — otherwise the router doesn't know where to send requests# ---------------------------------------------------------------------------# ---------------------------------------------------------------------------# Model — Llama-3.3-70B with anti-repetition settings# ---------------------------------------------------------------------------model = HFModel(model_id="meta-llama/Llama-3.3-70B-Instruct",provider="together",max_tokens=4096,temperature=0.7,repetition_penalty=1.1,)image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)230 unmodified lines231232233234235236237238239240241242243244245246247248249250251230 unmodified linesfinal_answer = FinalAnswerTool()# ---------------------------------------------------------------------------# Model — Llama-3.3-70B via Together AI## NOTE on anti-repetition parameters:# - `repetition_penalty` is NOT supported by the OpenAI-compatible chat# completions endpoint that HF Inference Providers use. It raises:# "InferenceClient.chat_completion() got an unexpected keyword argument"# - Use `frequency_penalty` / `presence_penalty` instead (range -2.0..2.0).# ---------------------------------------------------------------------------model = HFModel(model_id="meta-llama/Llama-3.3-70B-Instruct",provider="together",max_tokens=4096,temperature=0.7,frequency_penalty=0.3,presence_penalty=0.1,)image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
app.py+9-6