Instructions to use nairaxo/toumbert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nairaxo/toumbert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="nairaxo/toumbert")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("nairaxo/toumbert") model = AutoModelForMaskedLM.from_pretrained("nairaxo/toumbert") - Notebooks
- Google Colab
- Kaggle
How to use
You can use this model directly with a pipeline for masked language modeling:
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='nairaxo/toumbert')
>>> unmasker("rais wa [MASK] ya tanzania.")
Here is how to use this model to get the features of a given text in PyTorch:
from transformers import BertTokenizer, BertModel
tokenizer = BertTokenizer.from_pretrained('nairaxo/toumbert')
model = BertModel.from_pretrained("nairaxo/toumbert")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
and in TensorFlow:
from transformers import BertTokenizer, TFBertModel
tokenizer = BertTokenizer.from_pretrained('nairaxo/toumbert')
model = TFBertModel.from_pretrained("nairaxo/toumbert")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
- Downloads last month
- 11