Instructions to use abdullah1101/MDCAT-Llama3.2-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use abdullah1101/MDCAT-Llama3.2-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="abdullah1101/MDCAT-Llama3.2-3B")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("abdullah1101/MDCAT-Llama3.2-3B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use abdullah1101/MDCAT-Llama3.2-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "abdullah1101/MDCAT-Llama3.2-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "abdullah1101/MDCAT-Llama3.2-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/abdullah1101/MDCAT-Llama3.2-3B
- SGLang
How to use abdullah1101/MDCAT-Llama3.2-3B 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 "abdullah1101/MDCAT-Llama3.2-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "abdullah1101/MDCAT-Llama3.2-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "abdullah1101/MDCAT-Llama3.2-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "abdullah1101/MDCAT-Llama3.2-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use abdullah1101/MDCAT-Llama3.2-3B with Docker Model Runner:
docker model run hf.co/abdullah1101/MDCAT-Llama3.2-3B
Configuration Parsing Warning:Config file config.json cannot be fetched (too big)
Configuration Parsing Warning:Config file tokenizer_config.json cannot be fetched (too big)
MDCAT-Llama3.2-3B
This is a 4-bit quantized version of LLaMA 3.2 3B, fine-tuned for answering MDCAT (Medical and Dental College Admission Test) questions. It uses Parameter-Efficient Fine-Tuning (PEFT) with QLoRA to provide accurate responses to MDCAT-related queries in biology, chemistry, physics, and medical topics, while refusing non-MDCAT questions.
Model Details
Model Description
Designed to assist MDCAT students, this model delivers precise answers within its domain and rejects off-topic queries. It鈥檚 quantized to 4-bit precision for efficiency.
- Developed by: abdullah1101
- Model type: Text generation (causal language model)
- Language(s): English
- License: Apache 2.0
- Finetuned from: meta-llama/Llama-3.2-3B
- Size: 2.35GB (4-bit quantized) # Clarifies quantization
Model Sources
Uses
Direct Use
Use via the Hugging Face Inference API (once processed) or load locally for MDCAT question-answering.
Local Usage Example
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers import BitsAndBytesConfig
quant_config = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_compute_dtype=torch.float16)
model = AutoModelForCausalLM.from_pretrained(
"abdullah1101/MDCAT-Llama3.2-3B",
quantization_config=quant_config,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("abdullah1101/MDCAT-Llama3.2-3B")
inputs = tokenizer("Question: What is the function of the liver?\nAnswer: ", return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200, pad_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
- Downloads last month
- 8
Model tree for abdullah1101/MDCAT-Llama3.2-3B
Base model
meta-llama/Llama-3.2-3B