mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
refactor: remove unused sys import and improve module handling
This commit is contained in:
parent
374523438e
commit
18445b56d8
|
|
@ -22,8 +22,8 @@ class TorchBlocker:
|
|||
['torch']
|
||||
if
|
||||
i in name.lower()]) > 0:
|
||||
print(f"Disable package is being imported: 【{name}】", file=sys.stderr)
|
||||
pass
|
||||
import types
|
||||
return types.ModuleType(name)
|
||||
else:
|
||||
return self.original_import(name, *args, **kwargs)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue