unsloth
unsloth copied to clipboard
FastLanguageModel causes IPython dependency via transformers.utils.notebook
I am trying to follow along with the SFT example in the README (the very first one) and somehow importing FastLanguageModel
is causing notebook functionality to be imported via models.dpo
and transformers.utils.notebook
. This causes an undocumented dependency on IPython which is probably not necessary or desirable.
Version is 2024.2, installed to a conda environment via pip, according to the directions in the README.
File "/home/mschmill/Koda-API-Contract/src/koda_train/unsloth.py", line 4, in <module>
from unsloth import FastLanguageModel
File "/opt/anaconda/anaconda3/envs/smd/lib/python3.10/site-packages/unsloth/__init__.py", line 108, in <module>
from .models import *
File "/opt/anaconda/anaconda3/envs/smd/lib/python3.10/site-packages/unsloth/models/__init__.py", line 18, in <module>
from .dpo import PatchDPOTrainer
File "/opt/anaconda/anaconda3/envs/smd/lib/python3.10/site-packages/unsloth/models/dpo.py", line 15, in <module>
from transformers.utils.notebook import (
File "/opt/anaconda/anaconda3/envs/smd/lib/python3.10/site-packages/transformers/utils/notebook.py", line 20, in <module>
import IPython.display as disp
ModuleNotFoundError: No module named 'IPython'
Oh interesting! Thanks so much for the report - will add IPython to pyproject.toml!!
I think I fixed this now! I added a try
except
block :) Thanks for the report :)