Skip to content

Instantly share code, notes, and snippets.

@kristjan-eljand
Last active March 22, 2021 13:22
Show Gist options
  • Save kristjan-eljand/2bb142b95ac69e2566749a408e5d806b to your computer and use it in GitHub Desktop.
Save kristjan-eljand/2bb142b95ac69e2566749a408e5d806b to your computer and use it in GitHub Desktop.
Import distilgpt2 model and propose sentence beginnings
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