The LoRA adapter was merged into the base model, so this repository is intended for direct use with Hugging Face transformers.
For the optimized local-inference GGUF files, use:
yashm/gemma4-12b-bioinfo-GGUF.
This model is intended for research, education, and computational biology assistance. It is not a medical device and should not be used for clinical diagnosis, treatment decisions, or professional medical advice.
1import torch
2from transformers import AutoTokenizer, AutoModelForImageTextToText
3
4repo_id = "yashm/gemma4-12b-bioinfo"
5
6tokenizer = AutoTokenizer.from_pretrained(
7 repo_id,
8 trust_remote_code=True,
9)
10
11model = AutoModelForImageTextToText.from_pretrained(
12 repo_id,
13 device_map="auto",
14 dtype=torch.bfloat16,
15 attn_implementation="eager",
16 trust_remote_code=True,
17)
18
19system_prompt = (
20 "You are an expert bioinformatics assistant with deep knowledge of "
21 "genomics, proteomics, transcriptomics, sequence analysis, biological "
22 "databases, and bioinformatics tools. Provide accurate, concise, and "
23 "scientifically rigorous answers."
24)
25
26messages = [
27 {"role": "system", "content": system_prompt},
28 {"role": "user", "content": "Explain the difference between local and global sequence alignment."},
29]
30
31prompt = tokenizer.apply_chat_template(
32 messages,
33 tokenize=False,
34 add_generation_prompt=True,
35)
36
37inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
38
39with torch.inference_mode():
40 output_ids = model.generate(
41 **inputs,
42 max_new_tokens=512,
43 do_sample=True,
44 temperature=0.2,
45 top_p=0.9,
46 repetition_penalty=1.1,
47 pad_token_id=tokenizer.pad_token_id,
48 eos_token_id=tokenizer.eos_token_id,
49 )
50
51new_tokens = output_ids[0, inputs["input_ids"].shape[-1]:]
52answer = tokenizer.decode(new_tokens, skip_special_tokens=True).strip()
53print(answer)
The model may produce incorrect or incomplete biological interpretations. Always verify outputs against trusted scientific literature, databases, and domain experts.
1@misc{gemma4-12b-bioinfo_2026,
2 author = {yashm},
3 title = {gemma4-12b-bioinfo: Fine-Tuned Gemma 4 12B for Bioinformatics},
4 year = {2026},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/yashm/gemma4-12b-bioinfo}}
7}