torchtune as an optional dependency: Lazy Import #1519
Labels
actionable
Items in the backlog waiting for an appropriate impl/fix
good first issue
Good for newcomers
torchtune
Issue/PR related to torchtune components
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
🚀 The feature, motivation and pitch
We would like to make
torchtune
an optional dependency. The first step towards that is to avoid importingtorchtune
unless it is actively used.To make this migration easier, let's move the top level imports into the functions/classes that require them.
Here's an example where we delay imports here:
torchchat/torchchat/usages/eval.py
Lines 216 to 225 in 1384f7d
Task: Update all imports of
torchtune
in the repo, such that imports are only done when necessaryTo test your changes, run:
python torchchat.py generate llama3.2-1B
Alternatives
No response
Additional context
No response
RFC (Optional)
No response
The text was updated successfully, but these errors were encountered: