Text Generation
Transformers
PyTorch
Safetensors
Chinese
bloom
PULSE
llm
conversational
text-generation-inference
Instructions to use OpenMEDLab/PULSE-7bv5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenMEDLab/PULSE-7bv5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenMEDLab/PULSE-7bv5") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpenMEDLab/PULSE-7bv5") model = AutoModelForCausalLM.from_pretrained("OpenMEDLab/PULSE-7bv5", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenMEDLab/PULSE-7bv5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenMEDLab/PULSE-7bv5" # 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-7bv5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OpenMEDLab/PULSE-7bv5
- SGLang
How to use OpenMEDLab/PULSE-7bv5 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-7bv5" \ --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-7bv5", "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-7bv5" \ --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-7bv5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use OpenMEDLab/PULSE-7bv5 with Docker Model Runner:
docker model run hf.co/OpenMEDLab/PULSE-7bv5
Commit ·
353f9a8
1
Parent(s): de4e5fb
First model version
Browse files
README.md
CHANGED
|
@@ -35,17 +35,17 @@
|
|
| 35 |
由于模型参数量较小和自回归生成范式,尽管模型提供了有关疾病诊断和治疗的推理结果,但这些结果不能代替线下职业医生的建议和治疗方案。所有回答仅供参考,不应作为诊断或治疗的依据。我们强烈建议用户在需要诊断或治疗疾病时,寻求专业医生的帮助和建议。
|
| 36 |
|
| 37 |
### Elo评测
|
| 38 |
-
| model_name | model_size | MedQA_Mainland | PromptCBLUE |
|
| 39 |
-
|:-------------|:-------------|-----------------
|
| 40 |
-
| GPT4 | 220B*8(?) | 1118.20 | 1166.39 | 1122.20 | 1132.74 |
|
| 41 |
-
| ChatGPT | 175B(?) | 1083.05 | 1102.31 | 1098.38 | 1097.88 |
|
| 42 |
-
|
|
| 43 |
-
|
|
| 44 |
-
| QiZhenGPT | 13B | 952.66 | 929.56 | 1076.41 | 1006.85 |
|
| 45 |
-
| BianQue | 6B | 927.86 | 922.65 | 1050.22 | 1042.64 |
|
| 46 |
-
| Med-ChatGLM | 6B | 989.59 | 928.77 | 882.08 | 856.66 |
|
| 47 |
-
| BenTsao | 7B | 954.20 | 933.39 | 815.51 | 856.20 |
|
| 48 |
-
| DoctorGLM | 6B | 923.54 | 914.10 | 851.04 | 863.35 |
|
| 49 |
|
| 50 |
|
| 51 |
## 推理
|
|
|
|
| 35 |
由于模型参数量较小和自回归生成范式,尽管模型提供了有关疾病诊断和治疗的推理结果,但这些结果不能代替线下职业医生的建议和治疗方案。所有回答仅供参考,不应作为诊断或治疗的依据。我们强烈建议用户在需要诊断或治疗疾病时,寻求专业医生的帮助和建议。
|
| 36 |
|
| 37 |
### Elo评测
|
| 38 |
+
| model_name | model_size | ALL | MedQA_Mainland | PromptCBLUE | detailedMedQA | webMedQA |
|
| 39 |
+
|:-------------|:-------------|--------:|-----------------:|--------------:|----------------------:|-----------:|
|
| 40 |
+
| GPT4 | 220B*8(?) | 1243.79 | 1118.20 | 1166.39 | 1122.20 | 1132.74 |
|
| 41 |
+
| ChatGPT | 175B(?) | 1149.38 | 1083.05 | 1102.31 | 1098.38 | 1097.88 |
|
| 42 |
+
| PULSE_14b | 14B | 1114.23 | 1003.55 | 1055.56 | 1074.79 | 1074.28 |
|
| 43 |
+
| PULSE_7b | 7B | 1084.18 | 1047.35 | 1047.27 | 1029.37 | 1069.40 |
|
| 44 |
+
| QiZhenGPT | 13B | 979.94 | 952.66 | 929.56 | 1076.41 | 1006.85 |
|
| 45 |
+
| BianQue | 6B | 959.35 | 927.86 | 922.65 | 1050.22 | 1042.64 |
|
| 46 |
+
| Med-ChatGLM | 6B | 869.54 | 989.59 | 928.77 | 882.08 | 856.66 |
|
| 47 |
+
| BenTsao | 7B | 809.13 | 954.20 | 933.39 | 815.51 | 856.20 |
|
| 48 |
+
| DoctorGLM | 6B | 790.47 | 923.54 | 914.10 | 851.04 | 863.35 |
|
| 49 |
|
| 50 |
|
| 51 |
## 推理
|