Views
No views yet
google/medgemma-4b-it, tuned for converting clinical narratives into structured payloads that support Tanzania STG-aligned clinical decision support (CDS) workflows.google/medgemma-4b-itgoogle/medgemma-4b-it and used in a controlled backend or Space application to:/cds/evaluate)1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3from peft import PeftModel
4
5base_model_id = "google/medgemma-4b-it"
6adapter_id = "Japhari/medgemma-stg-cds-lora"
7
8tokenizer = AutoTokenizer.from_pretrained(base_model_id)
9if tokenizer.pad_token is None:
10 tokenizer.pad_token = tokenizer.eos_token
11
12base_model = AutoModelForCausalLM.from_pretrained(
13 base_model_id,
14 torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
15 device_map="auto" if torch.cuda.is_available() else None
16)
17
18model = PeftModel.from_pretrained(base_model, adapter_id)
19model.eval()google/medgemma-4b-itis a gated model. Ensure your Hugging Face account has accepted access before loading.
Japhari