text-generation-webui icon indicating copy to clipboard operation
text-generation-webui copied to clipboard

TypeError: not a string

Open Farquaad56 opened this issue 1 year ago • 5 comments

Hi, i have this issue when i load llama-7B on my RTX2080Ti

`(textgen) X:\LLama chat\text-generation-webui>python server.py --model llama-7b --load-in-8bit Loading llama-7b...

===================================BUG REPORT=================================== Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues

Loading checkpoint shards: 100%|███████████████████████████████████████████████████████| 33/33 [00:15<00:00, 2.13it/s] Traceback (most recent call last): File "X:\LLama chat\text-generation-webui\server.py", line 194, in shared.model, shared.tokenizer = load_model(shared.model_name) File "X:\LLama chat\text-generation-webui\modules\models.py", line 155, in load_model tokenizer = AutoTokenizer.from_pretrained(Path(f"models/{shared.model_name}/")) File "C:\Users\xx\anaconda3\envs\textgen\lib\site-packages\transformers\models\auto\tokenization_auto.py", line 679, in from_pretrained return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs) File "C:\Users\xx\anaconda3\envs\textgen\lib\site-packages\transformers\tokenization_utils_base.py", line 1804, in from_pretrained return cls.from_pretrained( File "C:\Users\xx\anaconda3\envs\textgen\lib\site-packages\transformers\tokenization_utils_base.py", line 1958, in from_pretrained tokenizer = cls(*init_inputs, **init_kwargs) File "C:\Users\xx\anaconda3\envs\textgen\lib\site-packages\transformers\models\llama\tokenization_llama.py", line 70, in init self.sp_model.Load(vocab_file) File "C:\Users\xx\anaconda3\envs\textgen\lib\site-packages\sentencepiece_init.py", line 905, in Load return self.LoadFromFile(model_file) File "C:\Users\xx\anaconda3\envs\textgen\lib\site-packages\sentencepiece_init.py", line 310, in LoadFromFile return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg) TypeError: not a string

(textgen) X:\LLama chat\text-generation-webui>`

Farquaad56 avatar Mar 10 '23 10:03 Farquaad56

Can you try reconverting the model following the instructions here?

https://github.com/oobabooga/text-generation-webui/wiki/LLaMA-model

oobabooga avatar Mar 10 '23 14:03 oobabooga

I restarted the conversion of the model with the last version script.uninstalled and reinstalled "transformer" with the "custom llama" version and I still have the same error message.

Farquaad56 avatar Mar 10 '23 14:03 Farquaad56

Did you move the tokenizer files into the model folder after converting? I made that mistake originally and had the same error.

BetaDoggo avatar Mar 10 '23 15:03 BetaDoggo

yes i have this files in "text-generation-webui\models\llama-7b" folder

  • config.json
  • generation_config.json
  • pytorch_model.bin.index.json
  • special_tokens_map.json
  • tokenizer_config.json
  • pytorch_model-00001-of-00033 to pytorch_model-00033-of-00033.bin

Farquaad56 avatar Mar 10 '23 15:03 Farquaad56

I believe you also need tokenizer.model. It might be in the folder of the original unconverted model rather than the one created by the conversion script.

BetaDoggo avatar Mar 10 '23 16:03 BetaDoggo

hi thanks, that was it i was missing this file ( tokenizer.model ), now i can launch the gui. i have a new error ( RuntimeError: CUDA error: an illegal memory access was encountered ) but my issue is solved. Thanks for answer

Farquaad56 avatar Mar 11 '23 00:03 Farquaad56