Instructions to use PharMolix/BioMedGPT-LM-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PharMolix/BioMedGPT-LM-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PharMolix/BioMedGPT-LM-7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PharMolix/BioMedGPT-LM-7B") model = AutoModelForCausalLM.from_pretrained("PharMolix/BioMedGPT-LM-7B", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PharMolix/BioMedGPT-LM-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PharMolix/BioMedGPT-LM-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PharMolix/BioMedGPT-LM-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PharMolix/BioMedGPT-LM-7B
- SGLang
How to use PharMolix/BioMedGPT-LM-7B 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 "PharMolix/BioMedGPT-LM-7B" \ --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": "PharMolix/BioMedGPT-LM-7B", "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 "PharMolix/BioMedGPT-LM-7B" \ --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": "PharMolix/BioMedGPT-LM-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PharMolix/BioMedGPT-LM-7B with Docker Model Runner:
docker model run hf.co/PharMolix/BioMedGPT-LM-7B
Commit ·
fba89a8
1
Parent(s): 5e62b7d
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,10 +7,9 @@ datasets:
|
|
| 7 |
---
|
| 8 |
# BioMedGPT-LM-7B
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
|
| 15 |
|
| 16 |
### Training Details
|
|
@@ -24,19 +23,21 @@ The model was trained with the following hyperparameters:
|
|
| 24 |
* Cutoff length: 2048
|
| 25 |
* Learning rate: 2e-5
|
| 26 |
|
| 27 |
-
|
| 28 |
-
(PMC)-ID and PubMed ID as criteria.
|
| 29 |
|
| 30 |
|
| 31 |
### Model Developers
|
| 32 |
PharMolix
|
| 33 |
|
| 34 |
### How to Use
|
| 35 |
-
BioMedGPT-LM-7B is a part of **[BioMedGPT-10B](https://github.com/BioFM/OpenBioMed)**, an open-source version of BioMedGPT. BioMedGPT is a multimodal generative pre-trained transformer (GPT) for biomedicine, which bridges the natural language modality and diverse biomed-
|
| 36 |
-
ical data modalities via a single GPT model. BioMedGPT aligns different biological modalities with the text modality via BioMedGPT-LM. The details of BioMedGPT-10B and BioMedGPT-LM-7B can be found in the [technical report]().
|
| 37 |
-

|
| 38 |
|
|
|
|
|
|
|
| 39 |
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
|
| 42 |
**Intended Use Cases**
|
|
|
|
| 7 |
---
|
| 8 |
# BioMedGPT-LM-7B
|
| 9 |
|
| 10 |
+
**BioMedGPT-LM-7B** is the first large generative language model based on Llama2 in the biomedical domain.
|
| 11 |
+
It was fine-tuned from the Llama2-7B-Chat with millions of biomedical papers from the [S2ORC corpus](https://github.com/allenai/s2orc/blob/master/README.md).
|
| 12 |
+
Through further fine-tuning, BioMedGPT-LM-7B outperforms or is on par with human and significantly larger general-purpose foundation models on several biomedical QA benchmarks.
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
### Training Details
|
|
|
|
| 23 |
* Cutoff length: 2048
|
| 24 |
* Learning rate: 2e-5
|
| 25 |
|
| 26 |
+
BioMedGPT-LM-7B is finetuned on over 26 billion tokens highly pertinent to the field of biomedicine.
|
| 27 |
+
The fine-tuning data are extracted from 5.5 million biomedical papers in S2ORC data using PubMed Central (PMC)-ID and PubMed ID as criteria.
|
| 28 |
|
| 29 |
|
| 30 |
### Model Developers
|
| 31 |
PharMolix
|
| 32 |
|
| 33 |
### How to Use
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
+
BioMedGPT-LM-7B is the generative language model of **[BioMedGPT-10B](https://github.com/BioFM/OpenBioMed)**, an open-source version of BioMedGPT.
|
| 36 |
+
BioMedGPT is an open multimodal generative pre-trained transformer (GPT) for biomedicine, which bridges the natural language modality and diverse biomedical data modalities via large generative language models.
|
| 37 |
|
| 38 |
+
More technical details of BioMedGPT-LM-7B, BioMedGPT-10B, and BioMedGPT can be found in the [technical report](https://pan.baidu.com/s/1iAMBkuoZnNAylhopP5OgEg?pwd=7a6b).
|
| 39 |
+
|
| 40 |
+

|
| 41 |
|
| 42 |
|
| 43 |
**Intended Use Cases**
|