Name | unirna JSON |
Version |
0.0.1
JSON |
| download |
home_page | |
Summary | The Large-Scale Pre-Trained Model for RNA |
upload_time | 2023-06-06 10:55:52 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3 |
license | |
keywords |
machine learning
transformers
unirna
rna
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
---
title: README
authors:
- Zhiyuan Chen
date: 2023-06-06
---
# README
本项目将一个UniRNA Checkpoint转换成一个HuggingFace Transformers兼容的Pretrained。
## 安装
```bash
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`来确保配置、模型和令牌器被正确注册。
```python
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")
```
## 文件结构
```bash
- {unirna}
- |- convert.py
- |- config.py
- |- model.py
- |- tokenizer.py
- |- template
- |- vocab.txt
- |- tokenizer_config.json
- |- special_tokens_map.json
```
Raw data
{
"_id": null,
"home_page": "",
"name": "unirna",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": "Zhiyuan Chen <chenzhiyuan@dp.tech>",
"keywords": "Machine Learning,Transformers,UniRNA,RNA",
"author": "",
"author_email": "Zhiyuan Chen <chenzhiyuan@dp.tech>",
"download_url": "https://files.pythonhosted.org/packages/e9/e0/3924e6efe131312cb60b1dba69c21c9c4fbc2b8a39f09e4c73fa83fbb353/unirna-0.0.1.tar.gz",
"platform": null,
"description": "---\ntitle: README\nauthors:\n - Zhiyuan Chen\ndate: 2023-06-06\n---\n\n# README\n\n\u672c\u9879\u76ee\u5c06\u4e00\u4e2aUniRNA Checkpoint\u8f6c\u6362\u6210\u4e00\u4e2aHuggingFace Transformers\u517c\u5bb9\u7684Pretrained\u3002\n\n## \u5b89\u88c5\n\n```bash\npip install .\n```\n \n## \u8f6c\u6362\n\n```\npython -m unirna.convert unirna_L16_E1024_DPRNA500M_STEP400K.pt \n```\n\n\u5bf9\u4e8e\u9884\u8bad\u7ec3\u7684Checkpoint\uff0c\u5728\u672c\u4f8b\u4e2d\u4f7f\u7528`unirna_L16_E1024_DPRNA500M_STEP400K.pt`\u3002\n`convert`\u5c06\u4f1a\u81ea\u52a8\u8bc6\u522b\u6a21\u578b\u7ed3\u6784\u53c2\u6570\uff0c\u751f\u6210\u6070\u5f53\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u8f6c\u6362\u6a21\u578b\u7ed3\u6784\u3002\n\u6700\u7ec8\u7ed3\u679c\u5c06\u4fdd\u5b58\u5728\u540c\u540d\uff08\u4f46\u6ca1\u6709\u6269\u5c55\u540d\uff09\u7684\u76ee\u5f55\u4e2d\uff0c\u672c\u4f8b\u4e3a`unirna_L16_E1024_DPRNA500M_STEP400K`\u3002\n\n## \u4f7f\u7528\n\n### DeepProtein\n\n\u5728DeepProtein\u8bad\u7ec3\u65f6\uff0c\u8bf7\u5728`--sequence.pretrained`\u6307\u5b9a\u8f6c\u6362\u540e\u7684\u6587\u4ef6\u8def\u5f84\uff0c\u5efa\u8bae\u6307\u5b9a\u7edd\u5bf9\u8def\u5f84\u3002\n\n```\npython -m deepprotein.train --sequence.pretrained /path/to/unirna_L16_E1024_DPRNA500M_STEP400K\n```\n\n### Transformers\n\n\u5728\u901a\u8fc7transformers\u4f7f\u7528\u8f6c\u6362\u540e\u7684Pretrained\u65f6\uff0c\u8bf7\u52a1\u5fc5`import unirna`\u6765\u786e\u4fdd\u914d\u7f6e\u3001\u6a21\u578b\u548c\u4ee4\u724c\u5668\u88ab\u6b63\u786e\u6ce8\u518c\u3002\n\n```python\nimport unirna # import\u7684\u987a\u5e8f\u4e0d\u91cd\u8981\nfrom transformers import AutoTokenizer, AutoModel\n\ntokenizer = AutoTokenizer.from_pretrained(\"unirna_L16_E1024_DPRNA500M_STEP400K\")\nmodel = AutoModel.from_pretrained(\"unirna_L16_E1024_DPRNA500M_STEP400K\")\n```\n\n## \u6587\u4ef6\u7ed3\u6784\n\n```bash\n- {unirna}\n- |- convert.py\n- |- config.py\n- |- model.py\n- |- tokenizer.py\n- |- template\n- |- vocab.txt\n- |- tokenizer_config.json\n- |- special_tokens_map.json\n```\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "The Large-Scale Pre-Trained Model for RNA",
"version": "0.0.1",
"project_urls": {
"documentation": "http://git.dp.tech/macromolecule/unirna_transformers",
"homepage": "http://git.dp.tech/macromolecule/unirna_transformers",
"repository": "http://git.dp.tech/macromolecule/unirna_transformers"
},
"split_keywords": [
"machine learning",
"transformers",
"unirna",
"rna"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "eb82bd81800747759cf6012211363a5831bd7b46b1693b564ce1a6dc0606f338",
"md5": "c86184794cbaaced364da7959c67e84c",
"sha256": "aeafb71f265037d52c5d5f94b222fb35df7223f2b1cad2e452217a487da20502"
},
"downloads": -1,
"filename": "unirna-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c86184794cbaaced364da7959c67e84c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 5832,
"upload_time": "2023-06-06T10:53:17",
"upload_time_iso_8601": "2023-06-06T10:53:17.882115Z",
"url": "https://files.pythonhosted.org/packages/eb/82/bd81800747759cf6012211363a5831bd7b46b1693b564ce1a6dc0606f338/unirna-0.0.1-py3-none-any.whl",
"yanked": true,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e9e03924e6efe131312cb60b1dba69c21c9c4fbc2b8a39f09e4c73fa83fbb353",
"md5": "edfb5ed81084cae077c9f8e9d1114909",
"sha256": "d39fe6d009b8ffea402ebce2cabcd4211185ceebfecbff4a1499e83c0d581ad1"
},
"downloads": -1,
"filename": "unirna-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "edfb5ed81084cae077c9f8e9d1114909",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 8750,
"upload_time": "2023-06-06T10:55:52",
"upload_time_iso_8601": "2023-06-06T10:55:52.141576Z",
"url": "https://files.pythonhosted.org/packages/e9/e0/3924e6efe131312cb60b1dba69c21c9c4fbc2b8a39f09e4c73fa83fbb353/unirna-0.0.1.tar.gz",
"yanked": true,
"yanked_reason": null
}
],
"upload_time": "2023-06-06 10:55:52",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "unirna"
}