The Large-Scale Pre-Trained Model for RNA
Project description
title: README authors: - Zhiyuan Chen date: 2023-06-06
README
本项目将一个UniRNA Checkpoint转换成一个HuggingFace Transformers兼容的Pretrained。
安装
pip install .
转换
python -m unirna.convert unirna_L16_E1024_DPRNA500M_STEP400K.pt
对于预训练的Checkpoint,在本例中使用unirna_L16_E1024_DPRNA500M_STEP400K.pt。
convert将会自动识别模型结构参数,生成恰当的配置文件,并转换模型结构。
最终结果将保存在同名(但没有扩展名)的目录中,本例为unirna_L16_E1024_DPRNA500M_STEP400K。
使用
DeepProtein
在DeepProtein训练时,请在--sequence.pretrained指定转换后的文件路径,建议指定绝对路径。
python -m deepprotein.train --sequence.pretrained /path/to/unirna_L16_E1024_DPRNA500M_STEP400K
Transformers
在通过transformers使用转换后的Pretrained时,请务必import unirna来确保配置、模型和令牌器被正确注册。
import unirna # import的顺序不重要
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("unirna_L16_E1024_DPRNA500M_STEP400K")
model = AutoModel.from_pretrained("unirna_L16_E1024_DPRNA500M_STEP400K")
文件结构
- {unirna}
- |- convert.py
- |- config.py
- |- model.py
- |- tokenizer.py
- |- template
- |- vocab.txt
- |- tokenizer_config.json
- |- special_tokens_map.json
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unirna-0.0.1.tar.gz.
File metadata
- Download URL: unirna-0.0.1.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d39fe6d009b8ffea402ebce2cabcd4211185ceebfecbff4a1499e83c0d581ad1
|
|
| MD5 |
edfb5ed81084cae077c9f8e9d1114909
|
|
| BLAKE2b-256 |
e9e03924e6efe131312cb60b1dba69c21c9c4fbc2b8a39f09e4c73fa83fbb353
|
File details
Details for the file unirna-0.0.1-py3-none-any.whl.
File metadata
- Download URL: unirna-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aeafb71f265037d52c5d5f94b222fb35df7223f2b1cad2e452217a487da20502
|
|
| MD5 |
c86184794cbaaced364da7959c67e84c
|
|
| BLAKE2b-256 |
eb82bd81800747759cf6012211363a5831bd7b46b1693b564ce1a6dc0606f338
|