Instructions to use alirezamsh/small100 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alirezamsh/small100 with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="alirezamsh/small100")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("alirezamsh/small100") model = AutoModelForSeq2SeqLM.from_pretrained("alirezamsh/small100") - Inference
- Notebooks
- Google Colab
- Kaggle
Error when run local
Downloading (…)tencepiece.bpe.model: 0%| | 0.00/2.42M [00:00<?, ?B/s]
Downloading (…)tencepiece.bpe.model: 100%|██████████| 2.42M/2.42M [00:00<00:00, 88.1MB/s]
Downloading (…)cial_tokens_map.json: 0%| | 0.00/1.56k [00:00<?, ?B/s]
Downloading (…)cial_tokens_map.json: 100%|██████████| 1.56k/1.56k [00:00<00:00, 1.47MB/s]
The tokenizer class you load from this checkpoint is not the same type as the class this function is called from. It may result in unexpected tokenization.
The tokenizer class you load from this checkpoint is 'M2M100Tokenizer'.
The class this function is called from is 'SMALL100Tokenizer'.
Traceback (most recent call last):
File "app.py", line 16, in
tokenizer = SMALL100Tokenizer.from_pretrained("alirezamsh/small100")
File "/home/user/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 2045, in from_pretrained
return cls._from_pretrained(
File "/home/user/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 2256, in _from_pretrained
tokenizer = cls(*init_inputs, **init_kwargs)
File "/home/user/app/tokenization_small100.py", line 148, in init
super().init(
File "/home/user/.local/lib/python3.8/site-packages/transformers/tokenization_utils.py", line 366, in init
self._add_tokens(self.all_special_tokens_extended, special_tokens=True)
File "/home/user/.local/lib/python3.8/site-packages/transformers/tokenization_utils.py", line 462, in _add_tokens
current_vocab = self.get_vocab().copy()
File "/home/user/app/tokenization_small100.py", line 270, in get_vocab
vocab = {self.convert_ids_to_tokens(i): i for i in range(self.vocab_size)}
File "/home/user/app/tokenization_small100.py", line 183, in vocab_size
return len(self.encoder) + len(self.lang_token_to_id) + self.num_madeup_words
AttributeError: 'SMALL100Tokenizer' object has no attribute 'encoder'
Hi, I have updated the tokenizer, please pull again.