Downloads · 30 days
50
58% of all-time downloads
MetaboLLM/MetaboLLM-Qwen3-4B
MetaboLLM-Qwen3-4B is a text generation model from MetaboLLM. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
PEFT LoRA adapter for metabolomics and biochemical knowledge tasks, trained from Qwen/Qwen3-4B-Instruct-2507. The base-model weights are not included in this repository.
Downloads · 30 days
50
58% of all-time downloads
All-time downloads
86
Public
Repo size
276 MB
Likes
1
Public
Click a slice to open those files.
.safetensors264 MB · 96%
From the Hugging Face model README
PEFT LoRA adapter for metabolomics and biochemical knowledge tasks, trained from
Qwen/Qwen3-4B-Instruct-2507. The base-model weights are not included in this repository.
Requires transformers>=4.51, since the chat template ships as a standalone
chat_template.jinja file.
pip install -U "transformers>=4.51" peft accelerate torch
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
BASE = "Qwen/Qwen3-4B-Instruct-2507"
ADAPTER = "MetaboLLM/MetaboLLM-Qwen3-4B"
tokenizer = AutoTokenizer.from_pretrained(ADAPTER)
model = AutoModelForCausalLM.from_pretrained(
BASE,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(model, ADAPTER)
model.eval()
messages = [
{"role": "system", "content": "You are a metabolomics expert."},
{"role": "user", "content": "What is the biological role of L-Alanine?"},
]
text = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:],
skip_special_tokens=True))
Call model.merge_and_unload() after loading to fold the adapter into the base
weights for faster repeated inference.