fix(utils): add missing importlib import to fix NameError (#2134)
This commit fixes a NameError that occurs when `importlib` is referenced in _utils.py without being imported, especially when UNSLOTH_USE_MODELSCOPE=1 is enabled. By adding the missing import statement, the code will no longer throw a NameError.
This commit is contained in:
parent
d56b82439d
commit
1ddcee387e
1 changed files with 1 additions and 0 deletions
|
|
@ -1243,6 +1243,7 @@ for j, function in enumerate(functions):
|
|||
except: continue
|
||||
pass
|
||||
|
||||
import importlib
|
||||
USE_MODELSCOPE = os.environ.get("UNSLOTH_USE_MODELSCOPE", "0") == "1"
|
||||
if USE_MODELSCOPE:
|
||||
if importlib.util.find_spec("modelscope") is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue