Me LLaMA: Foundation Large Language Models for Medical Applications
Paper • 2402.12749 • Published • 2
How to use YBXL/Med-LLaMA3-8B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="YBXL/Med-LLaMA3-8B") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("YBXL/Med-LLaMA3-8B")
model = AutoModelForCausalLM.from_pretrained("YBXL/Med-LLaMA3-8B")How to use YBXL/Med-LLaMA3-8B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "YBXL/Med-LLaMA3-8B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "YBXL/Med-LLaMA3-8B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/YBXL/Med-LLaMA3-8B
How to use YBXL/Med-LLaMA3-8B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "YBXL/Med-LLaMA3-8B" \
--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": "YBXL/Med-LLaMA3-8B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "YBXL/Med-LLaMA3-8B" \
--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": "YBXL/Med-LLaMA3-8B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use YBXL/Med-LLaMA3-8B with Docker Model Runner:
docker model run hf.co/YBXL/Med-LLaMA3-8B
Med-LLaMA3-8B is an 8-billion parameter medical language model that has undergone continual pre-training on LLaMA3-8B architecture using large-scale open-sourced medical data.
Med-LLaMA3-8B is trained on a large-scale dataset comprising: medical books, medical literature, clinical guidelines and a small portion of general domain data It is a study extension based on our previous Me-LLaMA paper: https://arxiv.org/pdf/2402.12749
If you use the model, please cite the following papers:
@misc{xie2024llama,
title={Me LLaMA: Foundation Large Language Models for Medical Applications},
author={Qianqian Xie and Qingyu Chen and Aokun Chen and Cheng Peng and Yan Hu and Fongci Lin and Xueqing Peng and Jimin Huang and Jeffrey Zhang and Vipina Keloth and Huan He and Lucila Ohno-Machido and Yonghui Wu and Hua Xu and Jiang Bian},
year={2024},
eprint={2402.12749},
archivePrefix={arXiv},
primaryClass={cs.CL}
}