Text Generation
Transformers
Safetensors
Portuguese
qwen2
qlora
merged
sentiment-analysis
portuguese
conversational
text-generation-inference
Instructions to use mdba/escutia-qlora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mdba/escutia-qlora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mdba/escutia-qlora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mdba/escutia-qlora") model = AutoModelForCausalLM.from_pretrained("mdba/escutia-qlora", 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 mdba/escutia-qlora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mdba/escutia-qlora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mdba/escutia-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mdba/escutia-qlora
- SGLang
How to use mdba/escutia-qlora 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 "mdba/escutia-qlora" \ --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": "mdba/escutia-qlora", "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 "mdba/escutia-qlora" \ --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": "mdba/escutia-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mdba/escutia-qlora with Docker Model Runner:
docker model run hf.co/mdba/escutia-qlora
Publicar adapter QLoRA do EscutIA
Browse files
README.md
CHANGED
|
@@ -1,23 +1,39 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: Qwen/Qwen2.5-1.5B-Instruct
|
| 3 |
+
base_model_relation: adapter
|
| 4 |
+
library_name: peft
|
| 5 |
+
language:
|
| 6 |
+
- pt
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
tags:
|
| 9 |
+
- qlora
|
| 10 |
+
- lora
|
| 11 |
+
- peft
|
| 12 |
+
- bitsandbytes
|
| 13 |
+
- sentiment-analysis
|
| 14 |
+
- portuguese
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# EscutIA QLoRA
|
| 18 |
+
|
| 19 |
+
Adapter QLoRA para classificação de sentimentos em português.
|
| 20 |
+
|
| 21 |
+
## Modelo-base
|
| 22 |
+
|
| 23 |
+
- modelo: `Qwen/Qwen2.5-1.5B-Instruct`
|
| 24 |
+
- revisão: `989aa79`
|
| 25 |
+
- quantização do treinamento: 4 bits, NF4, double quantization
|
| 26 |
+
- tarefa: classificação em `negativo`, `neutro` ou `positivo`
|
| 27 |
+
|
| 28 |
+
Este repositório contém um adapter, não um modelo completo. Para usar os pesos, carregue o modelo-base e aplique o adapter com PEFT.
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 32 |
+
from peft import PeftModel
|
| 33 |
+
|
| 34 |
+
base = AutoModelForCausalLM.from_pretrained('Qwen/Qwen2.5-1.5B-Instruct')
|
| 35 |
+
tokenizer = AutoTokenizer.from_pretrained('Qwen/Qwen2.5-1.5B-Instruct')
|
| 36 |
+
model = PeftModel.from_pretrained(base, 'SEU_USUARIO/escutia-qlora')
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
Consulte os arquivos de avaliação e comparação incluídos neste pacote para conhecer o desempenho observado.
|