Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language: es
|
4 |
+
base_model:
|
5 |
+
- Qwen/Qwen2.5-Coder-7B-Instruct
|
6 |
+
datasets:
|
7 |
+
- advbench
|
8 |
+
- openai/anthropic_harmless
|
9 |
+
library_name: transformers
|
10 |
+
pipeline_tag: text-generation
|
11 |
+
tags:
|
12 |
+
- LoRA
|
13 |
+
- Qwen
|
14 |
+
- unsloth
|
15 |
+
- 4bit
|
16 |
+
- spanish
|
17 |
+
- text-generation
|
18 |
+
---
|
19 |
+
|
20 |
+
# qwen25-adv-lora
|
21 |
+
|
22 |
+
Este modelo es una versi贸n de **Qwen2.5-Coder-7B-Instruct** afinada utilizando la t茅cnica **LoRA** (Low-Rank Adaptation) para mejorar su rendimiento en tareas de generaci贸n de texto y robustez frente a ejemplos adversariales, como los de *AdvBench*. El modelo ha sido fusionado (`merge_and_unload`) para facilitar su uso directo en inferencia.
|
23 |
+
|
24 |
+
## Detalles t茅cnicos
|
25 |
+
|
26 |
+
- Modelo base: `Qwen2.5-Coder-7B-Instruct`
|
27 |
+
- T茅cnica de ajuste: `LoRA` con `unsloth`
|
28 |
+
- Precision: `4-bit` (con `bitsandbytes`)
|
29 |
+
- Secuencia m谩xima: 4096 tokens
|
30 |
+
- Uso: generaci贸n de texto en espa帽ol e ingl茅s
|
31 |
+
|
32 |
+
## C贸mo usar
|
33 |
+
|
34 |
+
```python
|
35 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
36 |
+
|
37 |
+
model = AutoModelForCausalLM.from_pretrained("Alxis955/qwen25-adv-lora")
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained("Alxis955/qwen25-adv-lora")
|
39 |
+
|
40 |
+
prompt = "驴Cu谩l es la capital de Francia?"
|
41 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
42 |
+
outputs = model.generate(**inputs, max_new_tokens=100)
|
43 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|