E
commited on
Commit
•
f7561f0
1
Parent(s):
c739a80
Upload copy_of_text_gen_with_gpt_neo_1_5b_models_on_hugging_face_transformers.py
Browse files
copy_of_text_gen_with_gpt_neo_1_5b_models_on_hugging_face_transformers.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# -*- coding: utf-8 -*-
|
2 |
+
"""Copy of Text Gen with GPT Neo 1.5B Models on Hugging Face Transformers
|
3 |
+
|
4 |
+
Automatically generated by Colaboratory.
|
5 |
+
|
6 |
+
Original file is located at
|
7 |
+
https://colab.research.google.com/drive/1oIHB3hZtkCpEyA7Ha2rM8Esfx_TiX1Ln
|
8 |
+
"""
|
9 |
+
|
10 |
+
!pip install git+https://github.com/huggingface/transformers.git
|
11 |
+
|
12 |
+
from transformers import pipeline
|
13 |
+
|
14 |
+
generator = pipeline('text-generation', model='EleutherAI/gpt-neo-1.3B')
|
15 |
+
|
16 |
+
text = generator("My Name Is" , do_sample=True, max_length=700)
|
17 |
+
|
18 |
+
text
|
19 |
+
|
20 |
+
print(text[0]['generated_text'])
|
21 |
+
|