AI4S/ESMfold
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

组件版本

hdk:24.1.0.3
cann:8.0.RC3
python:3.9.2
torch:2.1.0
torch_npu:2.1.0.post8

安装ESMfold

pip install fair-esm
pip install "fair-esm[esmfold]"

安装torch&torch_npu

pip install torch==2.1.0
wget https://gitee.com/ascend/pytorch/releases/download/v6.0.rc3-pytorch2.1.0/torch_npu-2.1.0.post8-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
如果遇到证书不可信,需在命令结尾添加 --no-check-certificate
pip3 install torch_npu-2.1.0.post8-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

安装openfold

参考
https://modelers.cn/models/Ascend-AI4S/OpenFold1.0.0/blob/main/README.md

新建测试用例

touch test.fasta
vi test.fasta
将
>test
MKTVRQERLKSIVRILERSKEPVSGAQLAEELSVSRQVIVQDIAYLRSLGYNIVATPRGYVLAGG
复制到test.fasta内
:wq保存退出

下载权重

wget https://dl.fbaipublicfiles.com/fair-esm/models/esmfold_3B_v1.pt
wget https://dl.fbaipublicfiles.com/fair-esm/models/esm2_t36_3B_UR50D.pt
wget https://dl.fbaipublicfiles.com/fair-esm/regression/esm2_t36_3B_UR50D-contact-regression.pt
将权重移动至/root/.cache/torch/hub/checkpoints/

在环境中导入torch_npu

vi /usr/local/python3.9.2/lib/python3.9/site-packages/esm/scripts/fold.py
在torch下面导入torch_npu  和 from torch_npu.contrib import transfer_to_npu 

推理

执行
source /usr/local/Ascend/ascend_toolkit/set_env.sh
esm-fold -i test.fasta -o ./