zhangir-azerbayev / ProofNet

Benchmark for undergraduate-level formal mathematics
MIT License
90 stars 13 forks source link

How to inference the model? #13

Closed Dandelionym closed 1 year ago

Dandelionym commented 1 year ago

Hi, is there any code example to call the model? any interface/inference code?

HanYuanHsu commented 1 year ago

I also need a code example. I was trying to run of_hfmodel.py by typing python of_hfmodel.py in the command line prompt. But I believe it needs to read in another argument because I saw the following part in the code (note the sys.argv[1]):

with open(sys.argv[1]) as f: 
        cfg = yaml.safe_load(f)

    hfmodel = cfg["hfmodel"]
    BATCH_SIZE = cfg["batch_size"]
    BEFORE_EXAMPLE = cfg["before_example"]
    AFTER_EXAMPLE = cfg["after_example"]
    IN_KEY = cfg["in_key"]
    OUT_KEY = cfg["out_key"]
    ref_key = cfg["ref_key"]
    save_dir = cfg["save_dir"]
    save_file = cfg["save_file"]
    few_shot_prompt_path = cfg["few_shot_prompt_path"]
    STOP = cfg["stop"]
    max_tokens = cfg["max_tokens"]
    split = cfg["split"]

I believe cfg is some kind of dataset, but I don't know what it is and where to find it.

zhangir-azerbayev commented 1 year ago

cfg is a config file, which are located in eval/configs. So if you're in the eval directory example usage is python of_hfmodel.py configs/pythia-6.9b_6shot_formalize.yaml.