How to run this model
#1
by tenperformer - opened
from huggingface_hub import hf_hub_download
import torch
model = MediGPT()
model.load_state_dict(
torch.load(
hf_hub_download(
"tenperformer/MediGPT",
"pytorch_model.bin"
),
map_location="cpu"
)
)
model.eval()
context = torch.tensor(
[enc.encode("Symptoms of diabetes include")],
dtype=torch.long
)
generated = model.generate(
context,
max_new_tokens=100
)
print(enc.decode(generated[0].tolist()))