Last active
March 22, 2021 13:22
-
-
Save kristjan-eljand/2bb142b95ac69e2566749a408e5d806b to your computer and use it in GitHub Desktop.
Import distilgpt2 model and propose sentence beginnings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import pipeline | |
# Create text generator and import distilgpt2 model | |
generator = pipeline('text-generation', model='distilgpt2') | |
# 4 different Beginnings that I use for text generation | |
sentence_beginnings = ["In Estonia, our main source of energy is", | |
"The main task of the technology scout is", | |
"Renewable energy is important because", | |
"Electric Vehicles are changing the"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment