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
NameError: name 'importlib' is not defined when UNSLOTH_USE_MODELSCOPE=1 #2132
NameError Traceback (most recent call last)
in <cell line: 0>()
----> 1 from unsloth import FastLanguageModel
2 import torch
3 max_seq_length = 2048 # Choose any! We auto support RoPE Scaling internally!
4 dtype = None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
5 load_in_4bit = True # Use 4bit quantization to reduce memory usage. Can be False.
3 frames
/usr/local/lib/python3.11/dist-packages/unsloth/models/_utils.py in
1245 USE_MODELSCOPE = os.environ.get("UNSLOTH_USE_MODELSCOPE", "0") == "1"
1246 if USE_MODELSCOPE:
-> 1247 if importlib.util.find_spec("modelscope") is None:
1248 raise ImportError(f'You are using the modelscope hub, please install modelscope by pip install modelscope -U')
1249 pass
NameError: name 'importlib' is not defined
It seems that importlib is not defined in the context where unsloth is trying to use it, specifically when UNSLOTH_USE_MODELSCOPE is set to 1.
Activity
KareemMusleh commentedon Mar 21, 2025
my bad