![](https://cdn-avatars.huggingface.co/v1/production/uploads/63297908f0b2fc94904a65b8/hr-fUccqYPlTfmfKgoZAO.png)
Pryanshu Sharma PRO
5m4ck3r
AI & ML interests
None yet
Recent Activity
liked
a model
1 day ago
Kijai/HunyuanVideo_comfy
liked
a model
1 day ago
Comfy-Org/flux1-dev
published
a Space
4 days ago
LogicSpine/facebook-bart-large-mnli
Organizations
5m4ck3r's activity
![](https://cdn-avatars.huggingface.co/v1/production/uploads/63297908f0b2fc94904a65b8/hr-fUccqYPlTfmfKgoZAO.png)
Updated
β’
261
![](https://cdn-avatars.huggingface.co/v1/production/uploads/63462c815efccdc07f175568/uZC16M5xwQRMppBcZRrav.png)
Comfy-Org/flux1-dev
Updated
β’
448
![](https://cdn-avatars.huggingface.co/v1/production/uploads/654d427f023b93ef6a0d826b/sDbcinrIVnbu1ydAnFYLH.jpeg)
commented on
Introducing smolagents: simple agents that write actions in code.
6 days ago
Hi Great Project by the way but i am having a small issue,
I'm using smolagents with a QWEN 32B model (via CodeAgent) and have run into an issue with the generated code. Sometimes, the code produced by the agent includes multiple calls to final_answer
, with one appearing in the middle of the script. Because final_answer
is designed to signal the end of execution, any code following its first occurrence (for example, calls like task_to_do()
) doesn't get executed.
What I've tried:
- I've attempted to βteachβ the model to avoid placing
final_answer
in the middle of the code, but this approach has been unreliable.
My goal is:
- To have an execution model or workaround in smolagents that ensures the complete code block executes, even if a premature
final_answer
is generated.
Question:
Is there an agent configuration, workaround, or best practice within smolagents that can allow all code to execute even if final_answer
is called early? Any guidance or suggestions would be greatly appreciated.
Thanks in advance!