-
Notifications
You must be signed in to change notification settings - Fork 985
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
Exception during agent creation on Windows #572
Comments
@Bilokin which python version are you using? |
It is 3.12.3 on Windows, I just added that to the description |
Should then work without import os
prompt_templates = prompt_templates or yaml.safe_load(
open(os.path.join(os.path.dirname(__file__), "prompts", "toolcalling_agent.yaml")).read()
) and another option import pkgutil
prompt_templates = prompt_templates or yaml.safe_load(
pkgutil.get_data("smolagents", os.path.join("prompts", "toolcalling_agent.yaml"))
) |
I tried the first option on clean reinstall and it works as well, thanks! |
@Bilokin can you try the second one as well? So to figure out which way to go. Because the first one is by far not the best one. The second one is better. |
Hello,
I must confess that I use Anaconda on Windows PC to run smolagents, and version 1.7.0 was running fine, but I cannot run version 1.8.0 and higher because the following line crashes the agent creation:
smolagents/src/smolagents/agents.py
Line 651 in d74837b
I can confirm that I can run these versions on Linux environments, but on Windows it throws the following exception:
My version of python on Windows is 3.12.3
So, somehow,
prompts
is a resource on Linux and not a resource on Windows. As a private workaround I created__init__.py
file in theprompts
directory and it worked.Could you please tell me where this should be fixed?
If this is a problem with
importlib
, then I would like to report it, because I need GitHub points really badly...The text was updated successfully, but these errors were encountered: