lgq12697 commited on
Commit
ef14a1b
1 Parent(s): 8ff41bc

Add Plant DNAGPT model for promoter strength in protoplast prediction

Browse files
README.md CHANGED
@@ -1,3 +1,63 @@
1
- ---
2
- license: cc-by-nc-sa-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ widget:
4
+ - text: AGTCCAGTGGACGACCAGCCACGGCTCCGGTCTGTAGAACCATCGCGGAAACGGCTCGCAAAACTCTAAACAGCGCAAACGATGCGCGCGCCGAAGCAACCCGGCTCTACTTATAAAAACGTCCAACGGTGAGCACCGAGCAGCTACTACTCGTACTCCCCCCACCGATC
5
+ tags:
6
+ - DNA
7
+ - biology
8
+ - genomics
9
+ ---
10
+ # Plant foundation DNA large language models
11
+
12
+ The plant DNA large language models (LLMs) contain a series of foundation models based on different model architectures, which are pre-trained on various plant reference genomes.
13
+ All the models have a comparable model size between 90 MB and 150 MB, BPE tokenizer is used for tokenization and 8000 tokens are included in the vocabulary.
14
+
15
+
16
+ **Developed by:** zhangtaolab
17
+
18
+ ### Model Sources
19
+
20
+ - **Repository:** [Plant DNA LLMs](https://github.com/zhangtaolab/plant_DNA_LLMs)
21
+ - **Manuscript:** [Versatile applications of foundation DNA large language models in plant genomes]()
22
+
23
+ ### Architecture
24
+
25
+ The model is trained based on the OpenAI GPT-2 model with modified tokenizer specific for DNA sequence.
26
+
27
+ This model is fine-tuned for predicting promoter strength in maize protoplasts system.
28
+
29
+
30
+ ### How to use
31
+
32
+ Install the runtime library first:
33
+ ```bash
34
+ pip install transformers
35
+ ```
36
+
37
+ Here is a simple code for inference:
38
+ ```python
39
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
40
+
41
+ model_name = 'plant-dnagpt-promoter_strength_protoplast'
42
+ # load model and tokenizer
43
+ model = AutoModelForSequenceClassification.from_pretrained(f'zhangtaolab/{model_name}', trust_remote_code=True)
44
+ tokenizer = AutoTokenizer.from_pretrained(f'zhangtaolab/{model_name}', trust_remote_code=True)
45
+
46
+ # inference
47
+ sequences = ['TACTCTAATCGTATCAGCTGCACTTGCGTACAGGCTACCGGCGTCCTCAGCCACGTAAGAAAAGGCCCAATAAAGGCCCAACTACAACCAGCGGATATATATACTGGAGCCTGGCGAGATCACCCTAACCCCTCACACTCCCATCCAGCCGCCACCAGGTGCAGAGTGTT',
48
+ 'ATTTCAAAACTAGTTTTCTATAAACGAAAACTTATATTTATTCCGCTTGTTCCGTTTGATCTGCTGATTCGACACCGTTTTAACGTATTTTAAGTAAGTATCAGAAATATTAATGTGAAGATAAAAGAAAATAGAGTAAATGTAAAGGAAAATGCATAAGATTTTGTTGA']
49
+ pipe = pipeline('text-classification', model=model, tokenizer=tokenizer,
50
+ trust_remote_code=True, function_to_apply="none")
51
+ results = pipe(sequences)
52
+ print(results)
53
+
54
+ ```
55
+
56
+
57
+ ### Training data
58
+ We use GPT2ForSequenceClassification to fine-tune the model.
59
+ Detailed training procedure can be found in our manuscript.
60
+
61
+
62
+ #### Hardware
63
+ Model was trained on a NVIDIA GTX1080Ti GPU (11 GB).
added_tokens.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "<|endoftext|>": 8000,
3
+ "[PAD]": 8001
4
+ }
config.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "Plant_DNAGPT_promoter_strength_protoplast",
3
+ "activation_function": "gelu_new",
4
+ "architectures": [
5
+ "GPT2ForSequenceClassification"
6
+ ],
7
+ "attn_pdrop": 0.1,
8
+ "bos_token_id": 8000,
9
+ "embd_pdrop": 0.1,
10
+ "eos_token_id": 8000,
11
+ "id2label": {
12
+ "0": "Promoter strength in tobacco leaves"
13
+ },
14
+ "initializer_range": 0.02,
15
+ "label2id": {
16
+ "Promoter strength in tobacco leaves": 0
17
+ },
18
+ "layer_norm_epsilon": 1e-05,
19
+ "model_type": "gpt2",
20
+ "n_ctx": 512,
21
+ "n_embd": 768,
22
+ "n_head": 12,
23
+ "n_inner": null,
24
+ "n_layer": 12,
25
+ "n_positions": 1024,
26
+ "pad_token_id": 8001,
27
+ "problem_type": "regression",
28
+ "reorder_and_upcast_attn": false,
29
+ "resid_pdrop": 0.1,
30
+ "scale_attn_by_inverse_layer_idx": false,
31
+ "scale_attn_weights": true,
32
+ "summary_activation": null,
33
+ "summary_first_dropout": 0.1,
34
+ "summary_proj_to_labels": true,
35
+ "summary_type": "cls_index",
36
+ "summary_use_proj": true,
37
+ "task_specific_params": {
38
+ "text-generation": {
39
+ "do_sample": true,
40
+ "max_length": 50
41
+ }
42
+ },
43
+ "torch_dtype": "float32",
44
+ "transformers_version": "4.39.1",
45
+ "use_cache": true,
46
+ "vocab_size": 8002
47
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7414c07f1f9e6d72c2ec7d3614ac9227daf970eca65fb8be19af8bba26d4a84c
3
+ size 367969992
special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|endoftext|>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|endoftext|>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "unk_token": {
24
+ "content": "<|endoftext|>",
25
+ "lstrip": false,
26
+ "normalized": true,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "8000": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "8001": {
14
+ "content": "[PAD]",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ }
21
+ },
22
+ "bos_token": "<|endoftext|>",
23
+ "clean_up_tokenization_spaces": true,
24
+ "eos_token": "<|endoftext|>",
25
+ "errors": "replace",
26
+ "max_length": 512,
27
+ "model_max_length": 512,
28
+ "pad_to_multiple_of": null,
29
+ "pad_token": "[PAD]",
30
+ "pad_token_type_id": 0,
31
+ "padding_side": "right",
32
+ "stride": 0,
33
+ "tokenizer_class": "GPT2Tokenizer",
34
+ "truncation_side": "right",
35
+ "truncation_strategy": "longest_first",
36
+ "unk_token": "<|endoftext|>"
37
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff