Views
No views yet
Newer versions available: v1.1 and v2.1 (Best) achieve significantly lower loss with more training data.
Qwen/Qwen3.5-0.8B
└── v1 (1K samples) → loss 1.645 ← THIS MODEL
├── v1.1 (+1K Nemotron) → loss 1.440
└── v2 (+1K GPT-120B) → loss 1.473
└── v2.1 (+1K Nemotron) → loss 1.298 (BEST)| Model | Rounds | Samples | Loss | Output | Link |
|---|---|---|---|---|---|
| v1 | 1 | 1,000 | 1.645 | comma list | This model |
| v1.1 | 2 | 2,000 | 1.051 | JSON | v1.1 |
| v2 | 2 | 2,000 | 1.473 | comma list | v2 |
| v2.1 | 3 | 3,000 | 0.951 | JSON | v2.1 (Best) |
1from unsloth import FastLanguageModel
2from transformers import AutoTokenizer
3import torch
4
5model, tokenizer = FastLanguageModel.from_pretrained(
6 model_name="Shubh-0789/biomarker-qwen3.5-0.8b-lora",
7 max_seq_length=2048,
8 load_in_4bit=False,
9 load_in_16bit=True,
10 dtype=torch.bfloat16,
11)
12text_tokenizer = AutoTokenizer.from_pretrained("Shubh-0789/biomarker-qwen3.5-0.8b-lora")
13FastLanguageModel.for_inference(model)
14model.generation_config.pad_token_id = text_tokenizer.pad_token_id
15
16messages = [
17 {"role": "user", "content": "Extract all biomarker names from the following clinical text.\nText: The patient's HbA1c was 7.2%, CRP levels elevated at 15mg/L."}
18]
19inputs = text_tokenizer.apply_chat_template(
20 messages, tokenize=True, add_generation_prompt=True,
21 return_tensors="pt", return_dict=True,
22).to(model.device)
23
24with torch.no_grad():
25 outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.1, do_sample=True)
26
27result = text_tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
28print(result)
29# Output: HbA1c, CRPLoRA rank: 8, alpha: 16
Learning rate: 2e-4
Batch size: 8, gradient accumulation: 2
Epochs: 3
Quantization: 4-bit (Note: later versions use bf16 per Unsloth guidelines)