Text Generation
Transformers
PyTorch
Safetensors
Chinese
llama
PULSE
llm
conversational
text-generation-inference
Instructions to use OpenMEDLab/PULSE-20bv5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenMEDLab/PULSE-20bv5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenMEDLab/PULSE-20bv5") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpenMEDLab/PULSE-20bv5") model = AutoModelForCausalLM.from_pretrained("OpenMEDLab/PULSE-20bv5", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenMEDLab/PULSE-20bv5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenMEDLab/PULSE-20bv5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenMEDLab/PULSE-20bv5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OpenMEDLab/PULSE-20bv5
- SGLang
How to use OpenMEDLab/PULSE-20bv5 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 "OpenMEDLab/PULSE-20bv5" \ --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": "OpenMEDLab/PULSE-20bv5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "OpenMEDLab/PULSE-20bv5" \ --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": "OpenMEDLab/PULSE-20bv5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use OpenMEDLab/PULSE-20bv5 with Docker Model Runner:
docker model run hf.co/OpenMEDLab/PULSE-20bv5
Commit ·
568962b
1
Parent(s): 475cc92
Update README.md
Browse files
README.md
CHANGED
|
@@ -43,6 +43,24 @@ tags:
|
|
| 43 |
|
| 44 |
由于模型参数量较小和自回归生成范式,尽管模型提供了有关疾病诊断和治疗的推理结果,但这些结果不能代替线下职业医生的建议和治疗方案。所有回答仅供参考,不应作为诊断或治疗的依据。我们强烈建议用户在需要诊断或治疗疾病时,寻求专业医生的帮助和建议。
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
## 推理
|
| 48 |
|
|
|
|
| 43 |
|
| 44 |
由于模型参数量较小和自回归生成范式,尽管模型提供了有关疾病诊断和治疗的推理结果,但这些结果不能代替线下职业医生的建议和治疗方案。所有回答仅供参考,不应作为诊断或治疗的依据。我们强烈建议用户在需要诊断或治疗疾病时,寻求专业医生的帮助和建议。
|
| 45 |
|
| 46 |
+
### Elo评测
|
| 47 |
+
|
| 48 |
+
| Model Name | AVG Rank | MedQA-USMLE | MedQA-Mainland | PromptCBLUE | WebMedQA | CheckupQA | MedicineQA | DialogSumm | MedTriage (F1) |
|
| 49 |
+
|:-------------|-----------:|--------------:|-----------------:|--------------:|-----------:|------------:|-------------:|-------------:|-----------------:|
|
| 50 |
+
| GPT-4 | 1.25 | 1129 | 1117 | 1110 | 1116 | 1096 | 1098 | 1109 | 0.65 |
|
| 51 |
+
| PULSE-Pro | 1.75 | 1089 | 1092 | 1088 | 1119 | 1105 | 1083 | 1096 | 0.63 |
|
| 52 |
+
| ChatGPT | 4.00 | 1086 | 1057 | 1064 | 1053 | 1020 | 1029 | 1080 | 0.43 |
|
| 53 |
+
| PULSE-20b | 4.12 | 1042 | 1024 | 1039 | 1059 | 1049 | 1069 | 1076 | 0.40 |
|
| 54 |
+
| Baichuan2 | 4.50 | 1024 | 1041 | 1065 | 1044 | 1062 | 1035 | 1069 | 0.33 |
|
| 55 |
+
| ChatGLM3 | 5.62 | 1038 | 1062 | 997 | 1012 | 1003 | 1024 | 1021 | 0.06 |
|
| 56 |
+
| HuatuoGPT2 | 7.62 | 955 | 993 | 985 | 963 | 983 | 1003 | 980 | 0.01 |
|
| 57 |
+
| QiZhenGPT | 8.38 | 955 | 959 | 945 | 989 | 1039 | 932 | 921 | 0.00 |
|
| 58 |
+
| BenTsao | 8.75 | 961 | 921 | 936 | 910 | 927 | 986 | 920 | 0.02 |
|
| 59 |
+
| BianQue2 | 10.12 | 913 | 928 | 919 | 988 | 974 | 900 | 908 | 0.00 |
|
| 60 |
+
| MING | 10.75 | 902 | 909 | 924 | 867 | 862 | 960 | 918 | 0.01 |
|
| 61 |
+
| DoctorGLM | 11.12 | 906 | 896 | 930 | 879 | 880 | 880 | 905 | 0.00 |
|
| 62 |
+
|
| 63 |
+
** PULSE-20b=PULSE-20bv5 **
|
| 64 |
|
| 65 |
## 推理
|
| 66 |
|