minhtoan commited on
Commit
3647464
1 Parent(s): 2456870

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +50 -0
README.md ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ tags:
4
+ - en
5
+ - english
6
+ - gpt2
7
+ - gpt3
8
+ - text-generation
9
+ - lm
10
+ - nlp
11
+ datasets:
12
+ - cnn_dailymail
13
+ widget:
14
+ - text: "Ever noticed how plane seats appear to be getting smaller and smaller? "
15
+
16
+ inference:
17
+ parameters:
18
+ max_length: 120
19
+ do_sample: True
20
+ temperature: 1.0
21
+ ---
22
+
23
+ # GPT-3 small
24
+
25
+ Pretrained GPT-3 small, it's architecture intentionally resembles that of GPT-3, model was trained on CNN Daily Mail News dataset for text generation
26
+
27
+ # How to use the model
28
+
29
+ ~~~~
30
+ from transformers import GPT2Tokenizer, GPTNeoForCausalLM
31
+
32
+ tokenizer = GPT2Tokenizer.from_pretrained('gpt3-small-finetune-cnndaily-news-news')
33
+ model = GPTNeoForCausalLM.from_pretrained('gpt3-small-finetune-cnndaily-news-news')
34
+
35
+ text = "Ever noticed how plane seats appear to be getting smaller and smaller? "
36
+ input_ids = tokenizer.encode(text, return_tensors='pt')
37
+ max_length = 150
38
+
39
+ sample_outputs = model.generate(input_ids, do_sample=True, max_length=max_length)
40
+
41
+ for i, sample_output in enumerate(sample_outputs):
42
+ print(">> Generated text {}\n\n{}".format(i+1, tokenizer.decode(sample_output.tolist())))
43
+ print('\n---')
44
+ ~~~~
45
+
46
+
47
+ ## Author
48
+ `
49
+ Phan Minh Toan
50
+ `