Views
No views yet

cnmoro/GPT4-500k-Augmented-PTBR-Clean, rhaymison/orca-math-portuguese-64k, nicholasKluge/instruct-aira-dataset-v3).pipeline:1from transformers import pipeline
2
3generator = pipeline("text-generation", model="TucanoBR/Tucano-2b4-Instruct")
4
5completions = generator("<instruction>Qual cidade é a capital do estado do Rio Grande do Sul?</instruction>", num_return_sequences=2, max_new_tokens=100)
6
7for comp in completions:
8 print(f"🤖 {comp['generated_text']}")AutoTokenizer and AutoModelForCausalLM:1from transformers import GenerationConfig, TextGenerationPipeline, AutoTokenizer, AutoModelForCausalLM
2import torch
3
4# Specify the model and tokenizer
5model_id = "TucanoBR/Tucano-2b4-Instruct"
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(model_id)
8
9# Specify the generation parameters as you like
10generation_config = GenerationConfig(
11 **{
12 "do_sample": True,
13 "max_new_tokens": 2048,
14 "renormalize_logits": True,
15 "repetition_penalty": 1.2,
16 "temperature": 0.1,
17 "top_k": 50,
18 "top_p": 1.0,
19 "use_cache": True,
20 }
21)
22
23device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
24generator = TextGenerationPipeline(model=model, task="text-generation", tokenizer=tokenizer, device=device)
25
26# Generate text
27prompt = "<instruction>Qual cidade é a capital do estado do Rio Grande do Sul?</instruction>"
28completion = generator(prompt, generation_config=generation_config)
29print(completion[0]['generated_text'])Instruct versions of our models, we used AlpacaEval 2.0 with length-controlled win rates, a fast and relatively cheap evaluation method that is highly correlated with human preferences and evaluations of pairwise comparisons. To learn more about our evaluation read our documentation.| Avg. Length | Wins | Base Wins | Total Matches | Length-Controlled Win Rate (%) | LC Std. Error | |
|---|---|---|---|---|---|---|
| Llama-3.2-3B-Instruct | 1609 | 257 | 548 | 805 | 21.06 | 0.075 |
| Tucano-2b4-Instruct | 1843 | 151 | 654 | 805 | 13.00 | 0.071 |
| Tucano-1b1-Instruct | 1667 | 124 | 681 | 805 | 8.80 | 0.083 |
| Llama-3.2-1B-Instruct | 1429 | 99 | 706 | 805 | 7.15 | 0.057 |
| TeenyTinyLlama-460m-Chat | 1333 | 28 | 777 | 805 | 2.84 | 0.059 |
| Sabiá-7b | 5011 | 1 | 804 | 805 | 0.076 | 0.0043 |
| Gervásio-7b | 5740 | 1 | 804 | 805 | 0.026 | 0.0016 |
1@misc{correa2024tucanoadvancingneuraltext,
2 title={{Tucano: Advancing Neural Text Generation for Portuguese}},
3 author={Corr{\^e}a, Nicholas Kluge and Sen, Aniket and Falk, Sophia and Fatimah, Shiza},
4 year={2024},
5 eprint={2411.07854},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2411.07854},
9}
10
11@article{correa2025tucanoadvancingneuraltext,
12 title={{Tucano: Advancing Neural Text Generation for Portuguese}},
13 author={Corr{\^e}a, Nicholas Kluge and Sen, Aniket and Falk, Sophia and Fatimah, Shiza},
14 journal={Patterns},
15 publisher={Elsevier},
16 year={2025},
17 doi={10.1016/j.patter.2025.101325},
18 url={https://doi.org/10.1016/j.patter.2025.101325},
19 issn={2666-3899}
20}