You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FastLanguageModel causes IPython dependency via transformers.utils.notebook #209
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'
Activity
danielhanchen commentedon Mar 1, 2024
Oh interesting! Thanks so much for the report - will add IPython to pyproject.toml!!
danielhanchen commentedon Mar 3, 2024
I think I fixed this now! I added a
tryexceptblock :) Thanks for the report :)Merge pull request unslothai#209 from unslothai/feature/attachment-re…