Instructions to use NbAiLabArchive/test_w5_long with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NbAiLabArchive/test_w5_long with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="NbAiLabArchive/test_w5_long")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("NbAiLabArchive/test_w5_long") model = AutoModelForMaskedLM.from_pretrained("NbAiLabArchive/test_w5_long", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download generate_pytorch_model.py from NbAiLabArchive/test_w5_long: direct link, hf CLI and curl.
- Browser
- Download file 256 Bytes
-
https://huggingface.co/NbAiLabArchive/test_w5_long/resolve/c75a479f6357b4eac11978106894885616929d17/generate_pytorch_model.py
- Command line
-
hf download hf://NbAiLabArchive/test_w5_long@c75a479f6357b4eac11978106894885616929d17/generate_pytorch_model.py
-
curl -L -o generate_pytorch_model.py https://huggingface.co/NbAiLabArchive/test_w5_long/resolve/c75a479f6357b4eac11978106894885616929d17/generate_pytorch_model.py
256 Bytes
| # This script overwrites any existing PyTorch model. Generates a new one with an LM head from the pretrained Flax model. | |
| from transformers import RobertaForMaskedLM | |
| model = RobertaForMaskedLM.from_pretrained(".",from_flax=True) | |
| model.save_pretrained(".") | |