Views
No views yet


| Property | Value |
|---|---|
| Base model | Qwen2.5-7B-Instruct (4-bit) |
| Method | QLoRA via Unsloth |
| LoRA rank | 16 (alpha 32) |
| Trainable params | 40M / 7.6B (0.53%) |
| Adapter size | 155 MB |
| Training | 3 epochs, 280 samples, ~90 min on RTX 5090 |
| Final loss | 0.37 |
train_on_responses_only()| Metric | Value |
|---|---|
| Parse rate (valid PTV3Report) | ~60% |
| Verfahren exact match | ~89% |
| Cosine similarity (vs teacher) | 0.92 |
| ROUGE-L konsiliarbericht | 0.52 |
| ROUGE-L befund | 0.51 |
| ICD exact match | ~30% |
1from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 model_name="John-creative/ptv3-lora-qwen7b",
5 max_seq_length=4096,
6 dtype=None,
7 load_in_4bit=True,
8)
9FastLanguageModel.for_inference(model)
10
11messages = [
12 {"role": "system", "content": "Du bist ein Assistenzsystem, das aus einer dokumentierten Psychotherapie-Sitzung einen strukturierten Bericht an den Gutachter nach PTV 3 als JSON erzeugt. Gib ausschließlich gültiges JSON zurück, ohne zusätzlichen Text."},
13 {"role": "user", "content": "<session transcript here>"},
14]
15inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device)
16outputs = model.generate(input_ids=inputs, max_new_tokens=2048, temperature=0.1)
17print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))