当前位置:   article > 正文

2024年7月——使用ESM3(进化尺度的蛋白质语言模型)

2024年7月——使用ESM3(进化尺度的蛋白质语言模型)

需要的库:huggingface

path = Path(snapshot_download(repo_id="EvolutionaryScale/esm3-sm-open-v1"))

权重文件会下载到当前工作目录下的 .cache/huggingface/datasets/downloads 目录中。

安装:pip install esm

(esm2安装是 pip install fair-esm ,)

下面是使用说明,其中可以设置login(token="YOUR_TOKEN_HERE")为自己的huggingface令牌

from huggingface_hub import login
from esm.models.esm3 import ESM3
from esm.sdk.api import ESM3InferenceClient, ESMProtein, GenerationConfig

# This will prompt you to get an API key from huggingface hub, make one with
# "Read" or "Write" permission and copy it back here.
login()

# This will download the model weights and instantiate the model on your machine.
model: ESM3InferenceClient = ESM3.from_pretrained("esm3_sm_open_v1").to("cuda") # or "cpu"

# Generate a completi

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/787666
推荐阅读
相关标签
  

闽ICP备14008679号