Instructions to use pfnet/Llama3-Preferred-MedSwallow-70B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pfnet/Llama3-Preferred-MedSwallow-70B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pfnet/Llama3-Preferred-MedSwallow-70B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("pfnet/Llama3-Preferred-MedSwallow-70B") model = AutoModelForCausalLM.from_pretrained("pfnet/Llama3-Preferred-MedSwallow-70B") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use pfnet/Llama3-Preferred-MedSwallow-70B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pfnet/Llama3-Preferred-MedSwallow-70B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pfnet/Llama3-Preferred-MedSwallow-70B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/pfnet/Llama3-Preferred-MedSwallow-70B
- SGLang
How to use pfnet/Llama3-Preferred-MedSwallow-70B 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 "pfnet/Llama3-Preferred-MedSwallow-70B" \ --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": "pfnet/Llama3-Preferred-MedSwallow-70B", "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 "pfnet/Llama3-Preferred-MedSwallow-70B" \ --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": "pfnet/Llama3-Preferred-MedSwallow-70B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use pfnet/Llama3-Preferred-MedSwallow-70B with Docker Model Runner:
docker model run hf.co/pfnet/Llama3-Preferred-MedSwallow-70B
Llama3-Preferred-MedSwallow-70B
Model Description
Llama3-Preferred-MedSwallow-70B is a finetuned model based on tokyotech-llm/Llama-3-Swallow-70B-v0.1, which has undergone continued pretraining on an original corpus of medical-related text. For more details, please refer to our blog post at https://tech.preferred.jp/ja/blog/llama3-preferred-medswallow-70b/. The model is released under the META LLAMA 3 COMMUNITY LICENSE.
Model Performance
The table below shows the performance on the Japanese national medical licensing examinations from 2018 to 2022 (IgakuQA).
| Model ID | Average | 2018 | 2019 | 2020 | 2021 | 2022 |
|---|---|---|---|---|---|---|
| Llama3-Preferred-MedSwallow-70B | 395.2 | 407 | 390 | 391 | 393 | 395 |
| GPT-4 | 388.8 | 382 | 385 | 387 | 398 | 392 |
| Llama-3-Swallow-70B-v0.1 | 348.6 | 353 | 347 | 353 | 345 | 345 |
| Meta-Llama-3-70B | 334.6 | 353 | 340 | 348 | 314 | 318 |
| Qwen2-72B | 331.2 | 320 | 325 | 325 | 326 | 360 |
| gemma-2-27b | 316 | 337 | 298 | 327 | 296 | 322 |
| Swallow-70b-NVE-hf | 291.6 | 283 | 280 | 300 | 295 | 300 |
| Swallow-MX-8x7b-NVE-v0.1 | 280.8 | 262 | 273 | 291 | 284 | 294 |
| ChatGPT | 273.2 | 266 | 250 | 266 | 297 | 287 |
Limitations
The model was developed for research purposes and is not intended for clinical diagnosis. It is the users' responsibility to ensure compliance with applicable rules and regulations.
Contributors
Preferred Networks, Inc.
- Junichiro Iwasawa
- Keita Suzuki
- Wataru Kawakami
License
- Downloads last month
- 75