Views
No views yet
gpt2-ptbr-218m, is the final checkpoint of a three-stage pipeline:Note on parameter count: During export, the weight-tying between the token embedding and the language model head is preserved, and zero-initialized bias tensors are added for compatibility with Hugging Face'sGPT2LMHeadModel. These biases are not part of the original trained model and do not affect behavior.
<unk> = 0, <bos> = 1, <eos> = 2, <pad> = 31from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "augustoafleal/gpt2-ptbr-218m"
4
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForCausalLM.from_pretrained(model_id)
7
8prompt = "A inteligência artificial é"
9inputs = tokenizer(prompt, return_tensors="pt")
10
11output = model.generate(
12 **inputs,
13 max_new_tokens=100,
14 do_sample=True,
15 temperature=0.7,
16 top_k=40,
17 pad_token_id=tokenizer.pad_token_id,
18 eos_token_id=tokenizer.eos_token_id,
19)
20
21print(tokenizer.decode(output[0], skip_special_tokens=True))Stanford Alpaca: Taori et al., 2023. https://github.com/tatsu-lab/stanford_alpaca
Canarim-Instruct-PTBR: Domingues, 2023. https://huggingface.co/datasets/dominguesm/Canarim-Instruct-PTBR1@misc{gpt2ptbr218m,
2 title = {gpt2-ptbr-218m: A Portuguese GPT-2-like Autoregressive Language Model},
3 author = {Augusto Antônio Fontanive Leal},
4 year = {2026},
5 howpublished = {\url{https://huggingface.co/augustoafleal/gpt2-ptbr-218m}}
6}