starmpcc/Asclepius-Synthetic-Clinical-Notes
Viewer • Updated • 158k • 2.04k • 120
How to use starmpcc/Asclepius-Llama2-7B-Pretraining-Only with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="starmpcc/Asclepius-Llama2-7B-Pretraining-Only") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("starmpcc/Asclepius-Llama2-7B-Pretraining-Only")
model = AutoModelForCausalLM.from_pretrained("starmpcc/Asclepius-Llama2-7B-Pretraining-Only", device_map="auto")How to use starmpcc/Asclepius-Llama2-7B-Pretraining-Only with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "starmpcc/Asclepius-Llama2-7B-Pretraining-Only"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "starmpcc/Asclepius-Llama2-7B-Pretraining-Only",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/starmpcc/Asclepius-Llama2-7B-Pretraining-Only
How to use starmpcc/Asclepius-Llama2-7B-Pretraining-Only with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "starmpcc/Asclepius-Llama2-7B-Pretraining-Only" \
--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": "starmpcc/Asclepius-Llama2-7B-Pretraining-Only",
"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 "starmpcc/Asclepius-Llama2-7B-Pretraining-Only" \
--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": "starmpcc/Asclepius-Llama2-7B-Pretraining-Only",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use starmpcc/Asclepius-Llama2-7B-Pretraining-Only with Docker Model Runner:
docker model run hf.co/starmpcc/Asclepius-Llama2-7B-Pretraining-Only
This is an pre-trained Llama2-7B model, which was trained using causal language modeling on Asclepius-Synthetic-Clinical-Notes.
The Asclepius-Llama2-7B model was developed from this checkpoint by applying instruction fine-tuning.
This model is trained with causal launguage modeling, using Asclepius-Synthetic-Clinical-Notes.
ONLY USE THIS MODEL FOR RESEARCH PURPOSE!!
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("starmpcc/Asclepius-Llama2-7B-Pretraining-Only", use_fast=False)
model = AutoModelForCausalLM.from_pretrained("starmpcc/Asclepius-Llama2-7B-Pretraining-Only")
model_input = "YOUR INPUT"
input_ids = tokenizer(model_input, return_tensors="pt").input_ids
output = model.generate(input_ids)
print(tokenizer.decode(output[0]))
https://huggingface.co/datasets/starmpcc/Asclepius-Synthetic-Clinical-Notes
BibTeX:
@misc{kweon2023publicly,
title={Publicly Shareable Clinical Large Language Model Built on Synthetic Clinical Notes},
author={Sunjun Kweon and Junu Kim and Jiyoun Kim and Sujeong Im and Eunbyeol Cho and Seongsu Bae and Jungwoo Oh and Gyubok Lee and Jong Hak Moon and Seng Chan You and Seungjin Baek and Chang Hoon Han and Yoon Bin Jung and Yohan Jo and Edward Choi},
year={2023},
eprint={2309.00237},
archivePrefix={arXiv},
primaryClass={cs.CL}
}