Text Generation
Transformers
qwen3
dequantized
bf16
bfloat16
medical
biomedical
reasoning
bridge-model
fine-tuning
conversational
Instructions to use hassanshka/Biomni-R0-32B-INT4-to-BF16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hassanshka/Biomni-R0-32B-INT4-to-BF16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hassanshka/Biomni-R0-32B-INT4-to-BF16") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hassanshka/Biomni-R0-32B-INT4-to-BF16") model = AutoModelForCausalLM.from_pretrained("hassanshka/Biomni-R0-32B-INT4-to-BF16", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hassanshka/Biomni-R0-32B-INT4-to-BF16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hassanshka/Biomni-R0-32B-INT4-to-BF16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hassanshka/Biomni-R0-32B-INT4-to-BF16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hassanshka/Biomni-R0-32B-INT4-to-BF16
- SGLang
How to use hassanshka/Biomni-R0-32B-INT4-to-BF16 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "hassanshka/Biomni-R0-32B-INT4-to-BF16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hassanshka/Biomni-R0-32B-INT4-to-BF16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "hassanshka/Biomni-R0-32B-INT4-to-BF16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hassanshka/Biomni-R0-32B-INT4-to-BF16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use hassanshka/Biomni-R0-32B-INT4-to-BF16 with Docker Model Runner:
docker model run hf.co/hassanshka/Biomni-R0-32B-INT4-to-BF16
Add calibration data: README.md
Browse files- calibration_data/README.md +54 -0
calibration_data/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Calibration Dataset
|
| 2 |
+
|
| 3 |
+
This folder contains the calibration dataset used for quantizing the Biomni-R0-32B model.
|
| 4 |
+
|
| 5 |
+
## Dataset Statistics
|
| 6 |
+
|
| 7 |
+
| Metric | Value |
|
| 8 |
+
|--------|-------|
|
| 9 |
+
| **Total samples** | 123 |
|
| 10 |
+
| **Source** | Baseline R0 evaluation (successful completions only) |
|
| 11 |
+
| **Format** | prompt + full_response (complete trajectories) |
|
| 12 |
+
| **Average tokens** | 25,718 |
|
| 13 |
+
| **Total tokens** | 3,163,274 |
|
| 14 |
+
|
| 15 |
+
## Task Distribution
|
| 16 |
+
|
| 17 |
+
| Task | Samples |
|
| 18 |
+
|------|---------|
|
| 19 |
+
| crispr_delivery | 8 |
|
| 20 |
+
| gwas_causal_gene_gwas_catalog | 13 |
|
| 21 |
+
| gwas_causal_gene_opentargets | 13 |
|
| 22 |
+
| gwas_causal_gene_pharmaprojects | 13 |
|
| 23 |
+
| gwas_variant_prioritization | 13 |
|
| 24 |
+
| lab_bench_dbqa | 13 |
|
| 25 |
+
| lab_bench_seqqa | 13 |
|
| 26 |
+
| patient_gene_detection | 13 |
|
| 27 |
+
| rare_disease_diagnosis | 12 |
|
| 28 |
+
| screen_gene_retrieval | 12 |
|
| 29 |
+
|
| 30 |
+
## Files
|
| 31 |
+
|
| 32 |
+
- `calibration_data.json` - The final calibration dataset used for quantization
|
| 33 |
+
- `calibration_preview.txt` - Detailed statistics and sample preview
|
| 34 |
+
- `Data_r0_annotated_cleaned.jsonl` - Cleaned source data
|
| 35 |
+
- `prepare_calibration.py` - Script to prepare calibration data from raw annotations
|
| 36 |
+
- `clean_calibration_data.py` - Script to clean and filter the data
|
| 37 |
+
|
| 38 |
+
## Usage
|
| 39 |
+
|
| 40 |
+
The calibration data was used with LLM Compressor for both AWQ INT4 and FP8 quantization:
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
import json
|
| 44 |
+
from datasets import Dataset
|
| 45 |
+
|
| 46 |
+
with open("calibration_data/calibration_data.json", "r") as f:
|
| 47 |
+
raw_data = json.load(f)
|
| 48 |
+
|
| 49 |
+
calibration_data = Dataset.from_dict({"text": raw_data})
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## Why Custom Calibration?
|
| 53 |
+
|
| 54 |
+
Using domain-specific calibration data (biomedical tasks) instead of generic datasets (like C4) helps preserve model performance on the target domain during quantization.
|