z-liu commited on
Commit
5f13d79
·
verified ·
1 Parent(s): df80c36

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -3
README.md CHANGED
@@ -1,3 +1,25 @@
1
- ---
2
- license: bsd-3-clause
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: bsd-3-clause
3
+ ---
4
+
5
+ Modification of the base ProGen2-large model by [Nijkamp, et al.](https://arxiv.org/abs/2206.13517). The vocab_size is changed from 51200 to 32, the same as the ProGen2-small and ProGen2-medium. The model follows the original code of [Progen2](https://github.com/salesforce/progen/tree/main/progen2).
6
+
7
+
8
+ Example usage:
9
+
10
+ ```python
11
+ from models.modeling_progen import ProGenForCausalLM
12
+ from tokenizers import Tokenizer
13
+ import torch
14
+
15
+ # load model and tokenizer
16
+ model = ProGenForCausalLM.from_pretrained("IDEA-XL/progen2-large", torch_dtype="auto")
17
+ tokenizer = Tokenizer.from_pretrained("IDEA-XL/progen2-large")
18
+ tokenizer.no_padding()
19
+
20
+ # prepare input
21
+ prompt = "1MEVVIVTGMSGAGK"
22
+ input_ids = torch.tensor(tokenizer.encode(prompt).ids).to(model.device)
23
+
24
+ # forward
25
+ logits = model(input_ids).logits