sean0042/KorMedMCQA
Viewer β’ Updated β’ 7.49k β’ 1.36k β’ 36
How to use iRASC/BioLlama-Ko-8B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="iRASC/BioLlama-Ko-8B")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("iRASC/BioLlama-Ko-8B")
model = AutoModelForCausalLM.from_pretrained("iRASC/BioLlama-Ko-8B")
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 iRASC/BioLlama-Ko-8B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "iRASC/BioLlama-Ko-8B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "iRASC/BioLlama-Ko-8B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/iRASC/BioLlama-Ko-8B
How to use iRASC/BioLlama-Ko-8B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "iRASC/BioLlama-Ko-8B" \
--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": "iRASC/BioLlama-Ko-8B",
"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 "iRASC/BioLlama-Ko-8B" \
--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": "iRASC/BioLlama-Ko-8B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use iRASC/BioLlama-Ko-8B with Docker Model Runner:
docker model run hf.co/iRASC/BioLlama-Ko-8B
This is a merge of pre-trained language models created using mergekit.
| Model | Doctor | Nurse | Pharm | Avg |
|---|---|---|---|---|
| gpt-4-0613 | 75.09 | 85.86 | 83.22 | 81.39 |
| iRASC/BioLlama-Ko-8B | 45.26 | 63.37 | 58.47 | 55.70 |
| gpt-3.5-turbo-0613 | 41.75 | 62.18 | 56.35 | 53.43 |
| llama2-70b | 42.46 | 63.54 | 53.26 | 53.09 |
| SOLAR-10.7B-v1.0 | 37.19 | 55.54 | 54.07 | 48.93 |
| ProbeMedicalYonseiMAILab/medllama3-v20 | 37.19 | 54.68 | 50.65 | 47.51 |
| beomi/Llama-3-Open-Ko-8B | 38.95 | 53.49 | 46.09 | 46.18 |
This model was merged using the DARE TIES merge method using ProbeMedicalYonseiMAILab/medllama3-v20 as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
models:
- model: ProbeMedicalYonseiMAILab/medllama3-v20
- model: beomi/Llama-3-Open-Ko-8B
parameters:
density: 0.8
weight: 0.45
merge_method: dare_ties
base_model: ProbeMedicalYonseiMAILab/medllama3-v20
parameters:
int8_mask: true
dtype: bfloat16
docker model run hf.co/iRASC/BioLlama-Ko-8B