Skip to content
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 I need to manually install transformers module? #357

Open
auroradanier opened this issue Jan 25, 2025 · 4 comments · May be fixed by #360
Open

Do I need to manually install transformers module? #357

auroradanier opened this issue Jan 25, 2025 · 4 comments · May be fixed by #360
Assignees

Comments

@auroradanier
Copy link

I just installed smolagents with uv, when i run the sample test from the guide, it says transformers module not found.
Do I have to manually install it? Seems it's not included in the package.

Pls advise, thanks.

ubuntu@s:~/src$ uv add smolagents
Resolved 161 packages in 5.59s
Prepared 14 packages in 4.50s
Installed 14 packages in 219ms
 + duckduckgo-search==7.2.1
 + fsspec==2024.12.0
 + huggingface-hub==0.27.1
 + jinja2==3.1.5
 + markdown-it-py==3.0.0
 + markdownify==0.14.1
 + markupsafe==3.0.2
 + mdurl==0.1.2
 + pandas==2.2.3
 + primp==0.10.1
 + pygments==2.19.1
 + rich==13.9.4
 + smolagents==1.5.0
 + tzdata==2024.2

ubuntu@s:~/src/products$ uv run smola_test.py 
Traceback (most recent call last):
  File "/home/ubuntu/src/products/smola_test.py", line 3, in <module>
    from smolagents import CodeAgent, HfApiModel
  File "/home/ubuntu/src/.venv/lib/python3.13/site-packages/smolagents/__init__.py", line 19, in <module>
    from .agents import *
  File "/home/ubuntu/src/.venv/lib/python3.13/site-packages/smolagents/agents.py", line 37, in <module>
    from .models import (
    ...<2 lines>...
    )
  File "/home/ubuntu/src/.venv/lib/python3.13/site-packages/smolagents/models.py", line 28, in <module>
    from transformers import (
    ...<4 lines>...
    )
ModuleNotFoundError: No module named 'transformers'
@berkayguzel06
Copy link

The transformers module exist in the optional dependencies under pyproject.toml. But you can install it manually with 'pip install transformers' it worked for me.

@albertvillanova
Copy link
Member

Thanks for reporting. I think we made a regression in our last release.

@albertvillanova albertvillanova self-assigned this Jan 26, 2025
@albertvillanova albertvillanova linked a pull request Jan 26, 2025 that will close this issue
@MNIKIEMA
Copy link

Hey folks, I got the same issue by trying to test the text to SQL agent.

@albertvillanova
Copy link
Member

Once the fix integrated, we will make a patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants