microsoft / BioGPT

MIT License
4.3k stars 452 forks source link

Where does the relis-bin folder come from? #87

Open David-Degnan opened 1 year ago

David-Degnan commented 1 year ago

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?

David-Degnan commented 1 year ago

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.