Instructions to use bakrianoo/t5-arabic-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bakrianoo/t5-arabic-small with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("bakrianoo/t5-arabic-small") model = AutoModelForSeq2SeqLM.from_pretrained("bakrianoo/t5-arabic-small", device_map="auto") - Notebooks
- Google Colab
- Kaggle
issue
#2
by superAhmed91 - opened
I don't know if is there specific system information that the model fine tuned on or what but the model is not working correctly with me
I tried and here is my code
import torch
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_id = "bakrianoo/t5-arabic-small"
tokenizer = AutoTokenizer.from_pretrained( model_id, use_fast=False)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
model.eval()
question = 'how many governerates on egypt?'
inputs = tokenizer(
question,
return_tensors="pt",
truncation=True,
max_length=128
)
with torch.inference_mode():
output = model.generate(
**inputs,
max_new_tokens=48,
num_beams=1,
do_sample=False
)
answer = tokenizer.decode(
output[0],
skip_special_tokens=True
)
print(answer)
and the answer was <extra_id_0>