Spaces:
Sleeping
Sleeping
Carlos Bonilla
commited on
Commit
•
30dd8cb
1
Parent(s):
0b7906f
Update app.py
Browse files
app.py
CHANGED
@@ -2,4 +2,12 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
2 |
|
3 |
tokenizer = AutoTokenizer.from_pretrained("gpt2")
|
4 |
|
5 |
-
model = AutoModelForCausalLM.from_pretrained("gpt2")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
tokenizer = AutoTokenizer.from_pretrained("gpt2")
|
4 |
|
5 |
+
model = AutoModelForCausalLM.from_pretrained("gpt2")
|
6 |
+
|
7 |
+
from transformers import pipeline, set_seed
|
8 |
+
|
9 |
+
generator = pipeline('text-generation', model='gpt2')
|
10 |
+
|
11 |
+
set_seed(42)
|
12 |
+
|
13 |
+
generator("Hello, I'm a language model,", max_length=30, num_return_sequences=5)
|