Downloads · 30 days
21
21% of all-time downloads
Acryl-Jonathan-01/ALLM-Med-4B
ALLM-Med-4B is a text generation model from Acryl-Jonathan-01. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
This is a fully merged medical question-answering model based on Qwen/Qwen3-4B-Instruct-2507. The model has been fine-tuned using LoRA (with DoRA) on medical QA datasets and then merged into a single standalone model.
Downloads · 30 days
21
21% of all-time downloads
All-time downloads
101
Public
Parameters
4B
8.1 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors8 GB · 100%
From the Hugging Face model README
This is a fully merged medical question-answering model based on Qwen/Qwen3-4B-Instruct-2507. The model has been fine-tuned using LoRA (with DoRA) on medical QA datasets and then merged into a single standalone model.
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 1.0377 | 1.18 | 20 | 1.1270 | 0.7382 |
| 0.6478 | 2.35 | 40 | 0.8764 | 0.7388 |
| - | 3.00 | 51 | 0.7984 | 0.8218 |
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained(
"Acryl-Jonathan-01/qwen3-4b-medical-qa-merged",
torch_dtype="auto",
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
"Acryl-Jonathan-01/qwen3-4b-medical-qa-merged",
trust_remote_code=True
)
# Prepare messages
messages = [
{"role": "system", "content": "You are a helpful medical assistant."},
{"role": "user", "content": "What are the common symptoms of pneumonia?"}
]
# Generate response
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=True,
temperature=0.7,
top_p=0.8,
top_k=20
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
from vllm import LLM, SamplingParams
# Initialize vLLM
llm = LLM(
model="Acryl-Jonathan-01/qwen3-4b-medical-qa-merged",
trust_remote_code=True,
dtype="bfloat16"
)
# Sampling parameters
sampling_params = SamplingParams(
temperature=0.7,
top_p=0.8,
top_k=20,
max_tokens=512
)
# Generate
prompts = ["What are the symptoms of diabetes?"]
outputs = llm.generate(prompts, sampling_params)
for output in outputs:
print(output.outputs[0].text)
A Modelfile is included for easy deployment with Ollama:
# Create Ollama model
ollama create qwen3-medical -f Modelfile
# Run the model
ollama run qwen3-medical "What are the symptoms of hypertension?"
For resource-constrained environments, you can quantize the model:
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
# 4-bit quantization
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype="bfloat16",
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4"
)
model = AutoModelForCausalLM.from_pretrained(
"Acryl-Jonathan-01/qwen3-4b-medical-qa-merged",
quantization_config=bnb_config,
device_map="auto",
trust_remote_code=True
)
This model is designed for:
IMPORTANT DISCLAIMERS:
qwen3-4b-medical-qa-merged/
├── model-00001-of-00005.safetensors # Model weights (shard 1)
├── model-00002-of-00005.safetensors # Model weights (shard 2)
├── model-00003-of-00005.safetensors # Model weights (shard 3)
├── model-00004-of-00005.safetensors # Model weights (shard 4)
├── model-00005-of-00005.safetensors # Model weights (shard 5)
├── model.safetensors.index.json # Shard index
├── config.json # Model configuration
├── generation_config.json # Generation settings
├── tokenizer.json # Tokenizer
├── tokenizer_config.json # Tokenizer config
├── vocab.json # Vocabulary
├── merges.txt # BPE merges
├── chat_template.jinja # Chat template
├── special_tokens_map.json # Special tokens
├── added_tokens.json # Added tokens
├── Modelfile # Ollama modelfile
└── README.md # This file
Advantages of merged model:
Disadvantages:
If you use this model in your research or applications, please cite:
@misc{qwen3-4b-medical-qa-merged,
author = {Your Name},
title = {Qwen3-4B Medical QA},
year = {2025},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/Acryl-Jonathan-01/qwen3-4b-medical-qa-merged}}
}
Also consider citing the base model:
@misc{qwen3-2025,
title={Qwen3 Technical Report},
author={Qwen Team},
year={2025},
publisher={Alibaba Cloud},
url={https://huggingface.co/Qwen}
}
This model inherits the license from the base model Qwen/Qwen3-4B-Instruct-2507. Please refer to the base model's license for usage terms and conditions.
For issues, questions, or contributions: