Carvalho_pt-gl-1.3B
How to use
import torch
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
token_HF=""#Obter na páxina de HuggingFace
input_text = "Hoxe fai un bo día. O sol "
model_id = "Nos-PT/Carvalho_pt-gl-1.3B"
tokenizer = AutoTokenizer.from_pretrained(model_id, use_auth_token=token_HF)
model = AutoModelForCausalLM.from_pretrained(model_id, use_auth_token=token_HF)
generator = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
)
generation = generator(
input_text,
do_sample=True,
top_k=10,
eos_token_id=tokenizer.eos_token_id
)
print(f"Result: {generation[0]['generated_text']}")
- Downloads last month
- 471
Inference Providers
NEW
This model is not currently available via any of the supported third-party Inference Providers, and
the model is not deployed on the HF Inference API.