🚀 JSL-MedPhi2-2.7B
JSL-MedPhi2-2.7B 是由 John Snow Labs 開發的基於 microsoft/phi2
的模型,適用於醫療領域。該模型使用了監督微調(SFT)技術,並且在特定的許可證下可供使用。
🚀 快速開始
此模型由 John Snow Labs 開發。
該模型遵循 CC-BY-NC-ND 許可協議,同時也必須遵守此 使用政策。如果您需要將此模型用於商業用途,請通過 info@johnsnowlabs.com 與我們聯繫。
💻 使用示例
基礎用法
!pip install -qU transformers accelerate
from transformers import AutoTokenizer
import transformers
import torch
model = "johnsnowlabs/JSL-MedPhi2-2.7B"
messages = [{"role": "user", "content": "What is a large language model?"}]
tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
"text-generation",
model=model,
torch_dtype=torch.float16,
device_map="auto",
)
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])
🏆 評估
任務評估結果
任務 |
版本 |
過濾器 |
n-shot |
指標 |
值 |
|
標準誤差 |
stem |
N/A |
none |
0 |
acc_norm |
0.3904 |
± |
0.0066 |
|
|
none |
0 |
acc |
0.4402 |
± |
0.0058 |
- medmcqa |
Yaml |
none |
0 |
acc |
0.3899 |
± |
0.0075 |
|
|
none |
0 |
acc_norm |
0.3899 |
± |
0.0075 |
- medqa_4options |
Yaml |
none |
0 |
acc |
0.3920 |
± |
0.0137 |
|
|
none |
0 |
acc_norm |
0.3920 |
± |
0.0137 |
- anatomy (mmlu) |
0 |
none |
0 |
acc |
0.4815 |
± |
0.0432 |
- clinical_knowledge (mmlu) |
0 |
none |
0 |
acc |
0.6340 |
± |
0.0296 |
- college_biology (mmlu) |
0 |
none |
0 |
acc |
0.6181 |
± |
0.0406 |
- college_medicine (mmlu) |
0 |
none |
0 |
acc |
0.5665 |
± |
0.0378 |
- medical_genetics (mmlu) |
0 |
none |
0 |
acc |
0.6300 |
± |
0.0485 |
- professional_medicine (mmlu) |
0 |
none |
0 |
acc |
0.4522 |
± |
0.0302 |
- pubmedqa |
1 |
none |
0 |
acc |
0.7300 |
± |
0.0199 |
分組評估結果
分組 |
版本 |
過濾器 |
n-shot |
指標 |
值 |
|
標準誤差 |
stem |
N/A |
none |
0 |
acc_norm |
0.3904 |
± |
0.0066 |
|
|
none |
0 |
acc |
0.4402 |
± |
0.0058 |
📄 許可證
該模型遵循 CC-BY-NC-ND 4.0 許可協議。