Views
No views yet
1#!pip install transformers, torch, accelerate
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4tokenizer = AutoTokenizer.from_pretrained("lukasdrews/Gemma-4-E2B-IT-SFT-RLVR-Medical")
5model = AutoModelForCausalLM.from_pretrained("lukasdrews/Gemma-4-E2B-IT-SFT-RLVR-Medical")
6messages = [
7 {
8 "role": "user",
9 "content": [
10 {"type": "text", "text": "Do GEC produce and bear factor H under complement attack?"}
11 ]
12 },
13]
14inputs = tokenizer.apply_chat_template(
15 messages,
16 add_generation_prompt=True,
17 tokenize=True,
18 return_dict=True,
19 return_tensors="pt",
20).to(model.device)
21
22outputs = model.generate(**inputs, max_new_tokens=1024)
23print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))| Model | Quantization | PubMedQA (In-Domain) | MedQA-USMLE (Zero-Shot Transfer) |
|---|---|---|---|
| Gemma-4-E2B-it (base model) | - | 58.10 % | 29.54 % |
| Gemma-4-E2B-it + SFT + RLVR | - | 73.10 % | 43.05 % |
| Gemma-4-E2B-it + SFT + RLVR | Q8_0 | 72.40 % | 43.00 % |
| Gemma-4-E2B-it + SFT + RLVR | Q6_K | 72.10 % | 42.18 % |
| Gemma-4-E2B-it + SFT + RLVR | Q5_K_M | 72.00 % | 38.88 % |
| Gemma-4-E2B-it + SFT + RLVR | Q4_K_M | 71.80 % | 38.88 % |