ERROR: when run model in google colab

#5
by viettinh - opened

Em chạy model theo file colab của anh thì thấy lỗi này, cho em xin phiên bản chính xác của transformer, tokenizers, anh đang chạy được không ạ
/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_auth.py:94: UserWarning:
The secret HF_TOKEN does not exist in your Colab secrets.
To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.
You will be able to reuse this secret in all of your notebooks.
Please note that authentication is recommended but still optional to access public models or datasets.
warnings.warn(
config.json: 100%
 753/753 [00:00<00:00, 29.8kB/s]
tokenizer_config.json: 
 20.3k/? [00:00<00:00, 504kB/s]
tokenizer.json: 
 4.39M/? [00:00<00:00, 47.4MB/s]
special_tokens_map.json: 
 2.46k/? [00:00<00:00, 72.9kB/s]
Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.
WARNING:huggingface_hub.utils._http:Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.

KeyError Traceback (most recent call last)
/tmp/ipykernel_417/2070809706.py in <cell line: 0>()
4 model_path = "protonx-models/protonx-legal-tc"
5
----> 6 tokenizer = AutoTokenizer.from_pretrained(model_path)
7 model = AutoModelForSeq2SeqLM.from_pretrained(model_path)
8

3 frames
/usr/local/lib/python3.12/dist-packages/transformers/tokenization_utils_tokenizers.py in convert_to_native_format(cls, trust_remote_code, **kwargs)
125 vocab = list(map(tuple, vocab)) # TODO just for now
126 elif cls.model.name == "Unigram":
--> 127 if vocab and isinstance(vocab[0], (list, tuple)):
128 vocab = [tuple(item) for item in vocab]
129 elif cls.model.name == "WordLevel":

KeyError: 0

ProtonX org

You can use the following commands to downgrade to an older version:

!pip uninstall -y transformers
!pip install "transformers==4.57.6"

Sign up or log in to comment