Instructions to use Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA") model = AutoModelForCausalLM.from_pretrained("Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA
- SGLang
How to use Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA with Docker Model Runner:
docker model run hf.co/Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA
Tucano2-qwen-0.5b-Merge-ReLi-SA (Prior Model)
Este é um modelo especialista em análise de sentimento em língua portuguesa, construído usando a estratégia Knowledge Accumulation (Prior). O modelo foi inicialmente pre-mesclado (merged) com outros especialistas usando TIES Merge e, em seguida, sofreu ajuste fino (fine-tuning) no conjunto de dados ruanchaves/reli.
Este desenvolvimento faz parte do artigo científico submetido ao ENIAC 2026: "United Experts: Merging Small Language Models for Multi-Domain Sentiment Analysis in Portuguese".
📌 Detalhes do Modelo
- Modelos Base (Merge):
Assaoka/Tucano2-qwen-0.5B-BrighterAssaoka/Tucano2-qwen-0.5B-FinBERTAssaoka/Tucano2-qwen-0.5B-PhrasebankAssaoka/Tucano2-qwen-0.5B-GoEmotions- Tarefa: Análise de Sentimentos (positivo, negativo, neutro, misto) em resenhas literárias em português após alinhamento sequencial por Knowledge Accumulation (Prior).
- Domínio: Língua Portuguesa (PT-BR).
- Licença: Apache 2.0.
- Estratégia: Alinhamento sequencial via Knowledge Accumulation (Prior + Fine-tuning).
📊 Avaliação Completa (In-Domain & Out-Of-Domain)
Métricas padronizadas (Macro F1 · Micro F1 · Accuracy · Hamming Loss) calculadas sobre o conjunto de teste completo de cada domínio. A coluna Baseline corresponde ao modelo base Polygl0t/Tucano2-qwen-0.5B-Instruct sem fine-tuning.
| Dataset / Tarefa | Métrica | Valor | Baseline |
|---|---|---|---|
| RELI-SA | Macro F1 Micro F1 Accuracy Hamming Loss |
69.75% 80.41% 80.41% 0.1959 |
30.66% 37.07% 37.07% 0.6293 |
| BRIGHTER | Macro F1 Micro F1 Accuracy Hamming Loss |
37.72% 52.88% 37.98% 0.1479 |
33.47% 38.07% 24.66% 0.2731 |
| FINBERT-PT-BR | Macro F1 Micro F1 Accuracy Hamming Loss |
22.45% 31.68% 31.68% 0.6832 |
54.77% 66.34% 66.34% 0.3366 |
| FINANCIAL-PHRASEBANK | Macro F1 Micro F1 Accuracy Hamming Loss |
30.73% 59.96% 59.96% 0.4004 |
38.13% 39.32% 39.32% 0.6068 |
| GO-EMOTIONS | Macro F1 Micro F1 Accuracy Hamming Loss |
19.73% 36.39% 33.34% 0.0496 |
7.59% 10.31% 6.08% 0.0720 |
🚀 Como utilizar o modelo (vLLM ou Transformers)
O modelo responde a prompts estruturados com instruções do sistema em português. Exemplo real de inferência estruturada:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
messages = [
{"role": "system", "content": "Você é um classificador de sentimentos de resenhas de livros em português. Sua tarefa é analisar o texto fornecido pelo usuário e retornar um JSON válido no seguinte formato: {"sentimento": "positivo/negativo/neutro/misto"}. Responda APENAS com o JSON válido."},
{"role": "user", "content": "Resenha: Este livro é maravilhoso, a escrita é super fluida e envolvente, mas o final deixou a desejar."}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# Resposta esperada: {"sentimento": "misto"}
- Downloads last month
- 86
Model tree for Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA
Base model
Assaoka/Tucano2-qwen-0.5B-BrighterDataset used to train Assaoka/Tucano2-qwen-0.5b-Merge-ReLiSA
Evaluation results
- Macro F1 on reli-sa-labeltest set self-reported0.698
- Accuracy on reli-sa-labeltest set self-reported0.804