← 开源
Python
增长势头
+024 小时新增 Star0.0%
645
Star
63
Fork
+0
本周
1
贡献者
创建于 2022-12-14 · 更新于 2026-11-25 · 今日第 19923 名
主要开发者
README

BioMedLM

Code used for pre-training and fine-tuning the BioMedLM model.

Note: This model was previously known as PubMedGPT, but the NIH has asked us to change the name since they hold the trademark on "PubMed", so the new name is BioMedLM!

Links

Blog

Model

MosaicML Composer

Example Usage

import torch

from transformers import GPT2LMHeadModel, GPT2Tokenizer

device = torch.device("cuda")

tokenizer = GPT2Tokenizer.from_pretrained("stanford-crfm/BioMedLM")

model = GPT2LMHeadModel.from_pretrained("stanford-crfm/BioMedLM").to(device)

input_ids = tokenizer.encode(
    "Photosynthesis is ", return_tensors="pt"
).to(device)

sample_output = model.generate(input_ids, do_sample=True, max_length=50, top_k=50)

print("Output:\n" + 100 * "-")
print(tokenizer.decode(sample_output[0], skip_special_tokens=True))
排名相邻

AI Rank iPhone 版

随时追踪 AI 模型榜单

在 App Store 下载