BioGPT
BioGPT copied to clipboard
Where does the relis-bin folder come from?
Hopefully, this is a simple question but I'm struggling and could use help.
I could run the first example, but am stuck here:
import torch
from src.transformer_lm_prompt import TransformerLanguageModelPrompt
m = TransformerLanguageModelPrompt.from_pretrained(
"checkpoints/RE-DTI-BioGPT",
"checkpoint_avg.pt",
"data/KD-DTI/relis-bin", # <-- Where does this file come from? It's not in the repo.
tokenizer='moses',
bpe='fastbpe',
bpe_codes="data/bpecodes",
max_len_b=1024,
beam=1)
m.cuda()
src_text="" # input text, e.g., a PubMed abstract
src_tokens = m.encode(src_text)
generate = m.generate([src_tokens], beam=args.beam)[0]
output = m.decode(generate[0]["tokens"])
print(output)
Where does the relis-bin folder come from?
Duplicate:
You have to generate it by running the preprocessing (very fast). Check the related page in the example folder: https://github.com/microsoft/BioGPT/tree/main/examples/RE-DTI
I could only get the pre-processing scripts to complete on windows, not an Apple M1 Silicon Chip.