ChatDoctor
Collection
A collection of finetuned LLM models on the ChatDoctor HealthCareMagic dataset • 5 items • Updated
How to use geshijoker/HealthCareMagic_sft_llama3_instruct_full with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="geshijoker/HealthCareMagic_sft_llama3_instruct_full")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("geshijoker/HealthCareMagic_sft_llama3_instruct_full")
model = AutoModelForCausalLM.from_pretrained("geshijoker/HealthCareMagic_sft_llama3_instruct_full")
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=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use geshijoker/HealthCareMagic_sft_llama3_instruct_full with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "geshijoker/HealthCareMagic_sft_llama3_instruct_full"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "geshijoker/HealthCareMagic_sft_llama3_instruct_full",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/geshijoker/HealthCareMagic_sft_llama3_instruct_full
How to use geshijoker/HealthCareMagic_sft_llama3_instruct_full with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "geshijoker/HealthCareMagic_sft_llama3_instruct_full" \
--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": "geshijoker/HealthCareMagic_sft_llama3_instruct_full",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "geshijoker/HealthCareMagic_sft_llama3_instruct_full" \
--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": "geshijoker/HealthCareMagic_sft_llama3_instruct_full",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use geshijoker/HealthCareMagic_sft_llama3_instruct_full with Docker Model Runner:
docker model run hf.co/geshijoker/HealthCareMagic_sft_llama3_instruct_full
This model is a fine-tuned version of meta-llama/Meta-Llama-3-8B-Instruct on the healthcaremagic dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.2093 | 2.8429 | 500 | 1.7462 |
| Name | Checkpoint | Rouge1 | RougeL | Meteor | Bert Score |
|---|---|---|---|---|---|
| baseline instruct model | Meta-Llama-3-8B-Instruct | 0.254 | 0.128 | 0.222 | 0.747 |
| full fientune from inst | sft_llama3_instruct_full | 0.315 | 0.189 | 0.238 | 0.782 |
| lora sft from inst | sft_llama3_instruct_lora_all | 0.271 | 0.143 | 0.194 | 0.774 |
| lora sft from base | sft_llama3_lora_all | 0.239 | 0.113 | 0.211 | 0.735 |
| qlora sft from inst | sft_llama3_instruct_qlora_all | 0.137 | 0.071 | 0.102 | 0.679 |
| qlora sft from base | sft_llama3_qlora_all | 0.192 | 0.090 | 0.159 | 0.718 |
Base model
meta-llama/Meta-Llama-3-8B-Instruct