48 lines
1.7 KiB
Markdown
48 lines
1.7 KiB
Markdown
---
|
|
license: apache-2.0
|
|
base_model: Qwen/Qwen2.5-1.5B-Instruct
|
|
tags:
|
|
- qwen2
|
|
- text-generation
|
|
- structured-output
|
|
- intent-parsing
|
|
- merged
|
|
pipeline_tag: text-generation
|
|
---
|
|
# qwen2.5-1.5b-weather-intent-merged
|
|
|
|
Standalone **merged** model: `Qwen/Qwen2.5-1.5B-Instruct` + the weather-intent LoRA adapter,
|
|
merged to fp16 so it can be quantized to **GGUF** (llama.cpp / Ollama) or served
|
|
directly. Parses a natural-language weather question into a compact structured
|
|
intent (JSON).
|
|
|
|
- Adapter: [Nicholas55555/qwen2.5-1.5b-weather-intent](https://huggingface.co/Nicholas55555/qwen2.5-1.5b-weather-intent)
|
|
- Dataset: [Nicholas55555/weather-intent](https://huggingface.co/datasets/Nicholas55555/weather-intent)
|
|
|
|
## Results (held-out eval)
|
|
|
|
| metric | base | finetuned |
|
|
|---|---|---|
|
|
| valid JSON | 100.0% | 100.0% |
|
|
| exact match | 64.5% | 98.6% |
|
|
| field accuracy | 90.7% | 99.7% |
|
|
| slot F1 | 0.894 | 0.996 |
|
|
|
|
Base = few-shot; fine-tuned = zero-shot. Greedy decoding, identical prompt.
|
|
|
|
## Usage
|
|
|
|
```python
|
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
tok = AutoTokenizer.from_pretrained("Nicholas55555/qwen2.5-1.5b-weather-intent-merged")
|
|
model = AutoModelForCausalLM.from_pretrained("Nicholas55555/qwen2.5-1.5b-weather-intent-merged", device_map="auto")
|
|
|
|
sys = "You extract structured intent from weather questions. Return ONLY a JSON object..."
|
|
msgs = [{"role": "system", "content": sys},
|
|
{"role": "user", "content": "will it rain in Paris this weekend?"}]
|
|
prompt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
|
|
out = model.generate(**tok(prompt, return_tensors="pt").to(model.device), max_new_tokens=64)
|
|
print(tok.decode(out[0], skip_special_tokens=True))
|
|
```
|