Downloads · 30 days
8
6% of all-time downloads
krishna195/medgemma-anatomy-v2.1
medgemma-anatomy-v2.1 is a text generation model from krishna195. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Improved version with better generalization - fixes overfitting from v2.0.
Downloads · 30 days
8
6% of all-time downloads
All-time downloads
128
Public
Parameters
4.4B
6.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.2 GB · 99%
How the weights are stored.
U83.7B · 85%
From the Hugging Face model README
Improved version with better generalization - fixes overfitting from v2.0.
CONFIG = {
'max_seq_length': 1024,
'num_epochs': 3,
'batch_size': 4 (effective 16),
'learning_rate': 0.0001,
'lora_r': 32,
'lora_alpha': 64,
'lora_dropout': 0.1,
'weight_decay': 0.03,
'early_stopping_patience': 5
}
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_name = "krishna195/medgemma-anatomy-v2.1"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
)
question = "What is the carpal tunnel?"
prompt = f"<start_of_turn>user\n{question}<end_of_turn>\n<start_of_turn>model\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Apache 2.0