-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not record tool call id if no tool has been called #571
base: main
Are you sure you want to change the base?
Conversation
@aymeric-roucher another one here if you have some time. |
Thank you @sysradium! Could you please add a regression test for this? |
@aymeric-roucher sure, will try to figure out a way. |
893e409
to
0b82035
Compare
Added a test fixing some things along the way:
FAILED tests/test_models.py::ModelTests::test_get_mlx_message_no_tool - ModuleNotFoundError: Please install 'mlx-lm' extra to use 'MLXModel': `pip install 'smolagents[mlx-lm]'`
PYTHON='uv run python' make test
PYTHON='uv run python' make quality Or override it with python path you need. Just a bit of flexibility. It is backwards compatible, so if you don't override
|
9906c2a
to
2d199f5
Compare
2d199f5
to
bf2af27
Compare
Will |
@g-eoj I don't think so. You can check here https://pypi.org/project/mlx/#files that they have prebuilt binaries for linux and mac. As well as I found that it has a windows support ml-explore/mlx#1513 @aymeric-roucher a kind ping |
bf2af27
to
9968bdd
Compare
@albertvillanova rebased the change. |
9968bdd
to
a4673a9
Compare
@aymeric-roucher rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
The rebase seems did not work properly. I'm cherry-picking the relevant commits.
@albertvillanova what issues are there? I can't see conflicts atm |
Co-authored-by: Aymeric Roucher <69208727+aymeric-roucher@users.noreply.github.com>
a4673a9
to
60b91d2
Compare
60b91d2
to
db38e88
Compare
Rebased one more time, ran quality checks and tests. |
I came across this issue here: #570
The problem is that if you have callbacks which modify observations like it is done here https://github.com/huggingface/smolagents/blob/main/src/smolagents/vision_web_browser.py#L66
It may happen that there is no tool call recorded yet and hence
self.tool_calls
isNone
. (ref https://github.com/sysradium/smolagents/blob/web-tool-call-issue/src/smolagents/agents.py#L871)For example in my case it happened with
vision_web_browser.py
when the model did not return any Python code on the first call to it. That led to the exception here https://github.com/sysradium/smolagents/blob/web-tool-call-issue/src/smolagents/agents.py#L867 which happens right before we setmemory.step.tools_calls
.So essentially you end up having
data:,
as an observation but no recorded tool call.Maybe not the best solution, but I decided to just not print
Call id: ...
if there has been no successful tool call.