CoolFace
Modelpublic

hassanshka/Biomni-R0-32B-LoRA-Rank256

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
0likes11downloads
Model Card

Biomni-R0-32B LoRA Adapter (Method A, Rank 256)

This is a LoRA adapter extracted from the Biomni-R0-32B model using the original Qwen3-32B as the base model.

Adapter Details

ParameterValue
MethodMethod A - Direct LoRA extraction
Base ModelQwen/Qwen3-32B
Fine-tuned Modelbiomni/Biomni-R0-32B-Preview
Rank (r)256
Alpha256
Target Modulesqproj, kproj, vproj, oproj, gateproj, upproj, down_proj
Extraction ToolMergeKit (mergekit-extract-lora)

Usage with PEFT

python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
    "Qwen/Qwen3-32B",
    device_map="auto",
    torch_dtype="auto",
    trust_remote_code=True
)

# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "hassanshka/Biomni-R0-32B-LoRA-Rank256")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-32B")

# Inference
messages = [{"role": "user", "content": "Your biomedical question here"}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0]))

Usage with vLLM

python
from vllm import LLM, SamplingParams

llm = LLM(
    model="Qwen/Qwen3-32B",
    enable_lora=True,
    max_lora_rank=256
)

# Load LoRA at runtime
output = llm.generate(
    prompts,
    lora_request=LoRARequest("biomni", 1, "hassanshka/Biomni-R0-32B-LoRA-Rank256")
)

Extraction Process

The LoRA was extracted using MergeKit:

bash
mergekit-extract-lora \
    --model "biomni/Biomni-R0-32B-Preview" \
    --base-model "Qwen/Qwen3-32B" \
    --out-path "./lora_output" \
    --max-rank 256 \
    --device cuda

License

Apache 2.0

Citation

If you use this adapter, please cite both the original Qwen3 and Biomni models.