Error
I got an error running this in Colab
/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(
tokenizer_config.json: 56.7k/? [00:00<00:00, 1.58MB/s]tokenizer.json: 2.36M/? [00:00<00:00, 1.74MB/s]special_tokens_map.json: 100% 482/482 [00:00<00:00, 12.7kB/s]config.json: 1.09k/? [00:00<00:00, 34.3kB/s]configuration_doge.py: 13.3k/? [00:00<00:00, 340kB/s]A new version of the following files was downloaded from https://huggingface.co/SmallDoge/Doge-20M-Instruct:
- configuration_doge.py
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
modeling_doge.py: 54.4k/? [00:00<00:00, 1.48MB/s]A new version of the following files was downloaded from https://huggingface.co/SmallDoge/Doge-20M-Instruct:
- modeling_doge.py
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
ImportError Traceback (most recent call last)
/tmp/ipython-input-953548716.py in <cell line: 0>()
3
4 tokenizer = AutoTokenizer.from_pretrained("SmallDoge/Doge-20M-Instruct", trust_remote_code=True)
----> 5 model = AutoModelForCausalLM.from_pretrained("SmallDoge/Doge-20M-Instruct", trust_remote_code=True)
5 frames/usr/local/lib/python3.12/dist-packages/transformers/models/auto/auto_factory.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
584
585 if has_remote_code and trust_remote_code:
--> 586 model_class = get_class_from_dynamic_module(
587 class_ref, pretrained_model_name_or_path, code_revision=code_revision, **hub_kwargs, **kwargs
588 )
/usr/local/lib/python3.12/dist-packages/transformers/dynamic_module_utils.py in get_class_from_dynamic_module(class_reference, pretrained_model_name_or_path, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, repo_type, code_revision, **kwargs)
614 repo_type=repo_type,
615 )
--> 616 return get_class_in_module(class_name, final_module, force_reload=force_download)
617
618
/usr/local/lib/python3.12/dist-packages/transformers/dynamic_module_utils.py in get_class_in_module(class_name, module_path, force_reload)
309 # reload in both cases, unless the module is already imported and the hash hits
310 if getattr(module, "transformers_module_hash", "") != module_hash:
--> 311 module_spec.loader.exec_module(module)
312 module.transformers_module_hash = module_hash
313 return getattr(module, class_name)
/usr/lib/python3.12/importlib/_bootstrap_external.py in exec_module(self, module)
/usr/lib/python3.12/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)
~/.cache/huggingface/modules/transformers_modules/SmallDoge/Doge_hyphen_20M_hyphen_Instruct/dc9b359e279815619616f9b08d4c3e26d0d7dc0c/modeling_doge.py in
38 from transformers.modeling_utils import PreTrainedModel
39 from transformers.processing_utils import Unpack
---> 40 from transformers.utils import (
41 LossKwargs,
42 add_start_docstrings,
ImportError: cannot import name 'LossKwargs' from 'transformers.utils' (/usr/local/lib/python3.12/dist-packages/transformers/utils/init.py)
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
Open Examples