microsoft / evodiff

Generation of protein sequences and evolutionary alignments via discrete diffusion models
MIT License
526 stars 73 forks source link

msa_oa_ar_maxsub not recognized #31

Open jasonkyuyim opened 11 months ago

jasonkyuyim commented 11 months ago

Hi, I'm trying to run the example command for 1PRW in the README.

python evodiff/conditional_generation_msa.py --model-type msa_oa_ar_maxsub --cond-task scaffold --pdb 1prw --start-idxs 15 --end-idxs 34 --start-idxs 51 --end-idxs 70 --num-seqs 1 --query-only

However, I'm getting the following error.

Traceback (most recent call last):
  File "evodiff/conditional_generation_msa.py", line 1065, in <module>
    main()
  File "evodiff/conditional_generation_msa.py", line 75, in main
    raise Exception("Please select either msa_oa_dm_randsub, msa_oa_dm_maxsub, or esm_msa_1b baseline. You selected:", args.model_type)
Exception: ('Please select either msa_oa_dm_randsub, msa_oa_dm_maxsub, or esm_msa_1b baseline. You selected:', 'msa_oa_ar_maxsub')

Should I be running a different command to get the same results as the paper?

jasonkyuyim commented 11 months ago

Furthermore, when I try to use msa_oa_dm_maxsub

python evodiff/conditional_generation_msa.py --model-type msa_oa_dm_maxsub --cond-task scaffold --pdb 1prw --start-idxs 15 --end-idxs 34 --start-idxs 51 --end-idxs 70 --num-seqs 1 --query-only

I get the following error

Downloading: "https://zenodo.org/record/8045076/files/msa-oaar-maxsub.tar?download=1" to 
 75%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████                                            | 980M/1.28G [02:23<00:48, 7.17MB/s]
Traceback (most recent call last):
  File "evodiff/conditional_generation_msa.py", line 1065, in <module>
    main()
  File "evodiff/conditional_generation_msa.py", line 65, in main
    checkpoint = MSA_OA_DM_MAXSUB()
  File "evodiff/lib/python3.8/site-packages/evodiff/pretrained.py", line 300, in MSA_OA_DM_MAXSUB
    model, tokenizer = load_msa_checkpoint("msa-oaar-maxsub", file_path,
  File "evodiff/lib/python3.8/site-packages/evodiff/pretrained.py", line 69, in load_msa_checkpoint
    state_dict = download_model(model_name)
  File "evodiff/lib/python3.8/site-packages/evodiff/utils.py", line 383, in download_model
    state_dict = torch.hub.load_state_dict_from_url(url, progress=True, map_location=torch.device('cpu'))
  File "envs/evodiff/lib/python3.8/site-packages/torch/hub.py", line 746, in load_state_dict_from_url
    download_url_to_file(url, cached_file, hash_prefix, progress=progress)
  File "envs/evodiff/lib/python3.8/site-packages/torch/hub.py", line 636, in download_url_to_file
    f.write(buffer)
  File "/evodiff/lib/python3.8/tempfile.py", line 474, in func_wrapper
    return func(*args, **kwargs)
OSError: [Errno 5] Input/output error
sarahalamdari commented 3 months ago

Thanks for catching the typo in the example command - fixed in commit 683b08d

I installed in a clean environment and clean machine, and it does appear to download. Perhaps make sure you have 1.2 GB available for download? Your error log shows it appears to break mid-download.

python evodiff/conditional_generation_msa.py --model-type msa_oa_dm_maxsub --cond-task scaffold --pdb 1prw --start-idxs 15 --end-idxs 34 --start-idxs 51 --end-idxs 70 --num-seqs 1 --query-only
Downloading: "https://zenodo.org/record/8045076/files/msa-oaar-maxsub.tar?download=1" to /home/salamdari/.cache/torch/hub/checkpoints/msa-oaar-maxsub.tar
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.28G/1.28G [02:25<00:00, 9.45MB/s]
SEQ 0