McClain commited on
Commit
943062f
·
verified ·
1 Parent(s): daeaabf

Camera-ready README: simplified to what-it-is / quick start / citation

Browse files
Files changed (1) hide show
  1. README.md +30 -45
README.md CHANGED
@@ -1,56 +1,41 @@
1
- # PlasmidGPT Model
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- This is a GPT-2 based model for engineered plasmid sequence generation, converted from PyTorch `.pt` format to HuggingFace transformers format.
4
 
5
- This is a supervised fine-tuned (SFT) version of [PlasmidGPT](https://github.com/lingxusb/PlasmidGPT) for engineered plasmids. This work was done by **Angus Cunningham** while at **Prof. Chris Barnes' lab at UCL**.
6
 
7
- ## Model Details
8
-
9
- - **Architecture**: GPT-2
10
- - **Vocab Size**: 30,002
11
- - **Hidden Size**: 768
12
- - **Number of Layers**: 12
13
- - **Number of Heads**: 12
14
- - **Max Position Embeddings**: 2048
15
- - **Parameters**: ~124M
16
-
17
- ## Usage
18
 
19
  ```python
20
  from transformers import AutoModelForCausalLM, AutoTokenizer
21
 
22
- model = AutoModelForCausalLM.from_pretrained("./plasmidgpt-model")
23
- tokenizer = AutoTokenizer.from_pretrained("./plasmidgpt-model")
24
-
25
- # Basic generation
26
- inputs = tokenizer("ATGC", return_tensors="pt")
27
- outputs = model.generate(**inputs, max_length=100)
28
- generated_sequence = tokenizer.decode(outputs[0], skip_special_tokens=True)
29
- print(generated_sequence)
30
 
31
- # With sampling (for more diverse outputs)
32
- outputs = model.generate(**inputs, max_length=100, do_sample=True, temperature=0.8, top_p=0.9)
33
- generated_sequence = tokenizer.decode(outputs[0], skip_special_tokens=True)
34
- print(generated_sequence)
35
  ```
36
 
37
- ### Example Outputs
38
-
39
- **Input:** `ATGCGATCG`
40
- **Generated:** `ATGCGATCGGTGGTAGGCACTGGATGATGGCCCTGCAGTGTAGCCGTAGTTATGAGCCTCGGGATTCTTTGATGATTCAGCCACCCTCATCATCCTCCTCCTCC...`
41
-
42
- **Input:** `ATGGCC`
43
- **Generated:** `ATGGCCTACATACCTTCAATTACCGAAACAAGGTGGTTCATCTCTAACGCTGTCCATAAAACCGCCCAGTCTAGCTATCGCCATTTGCGCATCTAACGTGGTAGGCACTCCGGGTCCGCGCC...`
44
 
45
- ## Compatible With
46
-
47
- This model is compatible with the architecture from [McClain/plasmidgpt-addgene-gpt2](https://huggingface.co/McClain/plasmidgpt-addgene-gpt2), but with different weights from the pretrained model.
48
-
49
- ## Files
50
-
51
- - `config.json`: Model configuration
52
- - `generation_config.json`: Generation parameters
53
- - `model.safetensors`: Model weights in SafeTensors format
54
- - `tokenizer.json`: Fast tokenizer data
55
- - `tokenizer_config.json`: Tokenizer configuration
56
- - `special_tokens_map.json`: Special token mappings
 
1
+ ---
2
+ license: mit
3
+ library_name: transformers
4
+ pipeline_tag: text-generation
5
+ base_model: UCL-CSSB/PlasmidGPT
6
+ tags:
7
+ - biology
8
+ - plasmid
9
+ - dna
10
+ - synthetic-biology
11
+ - gpt2
12
+ ---
13
 
14
+ # PlasmidGPT-SFT
15
 
16
+ Supervised fine-tune of [PlasmidGPT](https://huggingface.co/UCL-CSSB/PlasmidGPT) on a curated corpus of ~15k engineered *E. coli* plasmids from PlasmidScope and Addgene (Cunningham et al., 2025). Used as a baseline for the GRPO-trained [PlasmidGPT-GRPO](https://huggingface.co/UCL-CSSB/PlasmidGPT-GRPO).
17
 
18
+ ## Quick start
 
 
 
 
 
 
 
 
 
 
19
 
20
  ```python
21
  from transformers import AutoModelForCausalLM, AutoTokenizer
22
 
23
+ model = AutoModelForCausalLM.from_pretrained("UCL-CSSB/PlasmidGPT-SFT")
24
+ tokenizer = AutoTokenizer.from_pretrained("UCL-CSSB/PlasmidGPT-SFT")
 
 
 
 
 
 
25
 
26
+ input_ids = tokenizer("ATG", return_tensors="pt").input_ids
27
+ outputs = model.generate(input_ids, max_new_tokens=512, do_sample=True, temperature=1.0)
28
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
 
29
  ```
30
 
31
+ ## Citation
 
 
 
 
 
 
32
 
33
+ ```bibtex
34
+ @article{cunningham2025plasmidsft,
35
+ title = {Generative design and construction of functional plasmids with a {DNA} language model},
36
+ author = {Cunningham, Angus G. and Dekker, Linda and Shcherbakova, Anastasiia and Barnes, Chris P.},
37
+ journal = {bioRxiv},
38
+ year = {2025},
39
+ doi = {10.64898/2025.12.06.692736}
40
+ }
41
+ ```