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

Halve import time by removing torch dependency #147

Merged
merged 4 commits into from
Jan 10, 2025

Conversation

aymeric-roucher
Copy link
Collaborator

Issue raised by @xianminx: #100

This PR removes torch dependency to make install and imports faster.

Tested on this script:

import time

t0 = time.time()
from smolagents import CodeAgent, HfApiModel
t1 = time.time()

print(f"Total time: {t1 - t0:.2f}")

The runtime falls from 6.52s to 3.8s, nearly halved!

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@aymeric-roucher aymeric-roucher merged commit eca8380 into main Jan 10, 2025
4 of 5 checks passed
Ayuilos pushed a commit to Ayuilos/smolagents that referenced this pull request Jan 11, 2025
* Halve import time by removing torch dependency
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 this pull request may close these issues.

2 participants