Closed blackcement closed 1 year ago
Try install sentencepiece and update other python modules by command: D:\GPT4All_GPU\venv\Scripts\python.exe -m pip install -U transformers sentencepiece peft accelerate bitsandbytes and run Saiga.py again...
From the initial post, it is not even clear what "Saiga.py" is. Seems like there is a circular import somewhere, as stated in the error message.
D:\GPT4All_GPU\venv\Scripts\python.exe D:/GPT4All_GPU/Saiga.py CUDA version: 11.1 Traceback (most recent call last): File "D:\GPT4All_GPU\venv\Lib\site-packages\transformers\utils\import_utils.py", line 1125, in _get_module return importlib.import_module("." + module_name, self.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\importlib__init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1126, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "D:\GPT4All_GPU\venv\Lib\site-packages\transformers\models__init__.py", line 15, in
from . import (
File "D:\GPT4All_GPU\venv\Lib\site-packages\transformers\models\mt5__init.py", line 29, in
from ..t5.tokenization_t5 import T5Tokenizer
File "D:\GPT4All_GPU\venv\Lib\site-packages\transformers\models\t5\tokenization_t5.py", line 24, in
import sentencepiece as spm
File "D:\GPT4All_GPU\venv\Lib\site-packages\sentencepiece\ init__.py", line 13, in
from . import _sentencepiece
ImportError: cannot import name '_sentencepiece' from partially initialized module 'sentencepiece' (most likely due to a circular import) (D:\GPT4All_GPU\venv\Lib\site-packages\sentencepiece\ init__.py)
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "D:\GPT4All_GPU\Saiga.py", line 7, in
from peft import PeftModel, PeftConfig
File "D:\GPT4All_GPU\venv\Lib\site-packages\peft__init.py", line 22, in
from .auto import (
File "D:\GPT4All_GPU\venv\Lib\site-packages\peft\auto.py", line 21, in
from transformers import (
File "", line 1229, in _handle_fromlist
File "D:\GPT4All_GPU\venv\Lib\site-packages\transformers\utils\import_utils.py", line 1115, in getattr__
module = self._get_module(self._class_to_module[name])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\GPT4All_GPU\venv\Lib\site-packages\transformers\utils\import_utils.py", line 1127, in _get_module
raise RuntimeError(
RuntimeError: Failed to import transformers.models.auto because of the following error (look up to see its traceback):
cannot import name '_sentencepiece' from partially initialized module 'sentencepiece' (most likely due to a circular import) (D:\GPT4All_GPU\venv\Lib\site-packages\sentencepiece__init__.py)