Skip to content

Instantly share code, notes, and snippets.

@enesozeren
Last active February 2, 2024 19:04
Show Gist options
  • Save enesozeren/b2c7b505f5a33e0948cf90f8df0f6149 to your computer and use it in GitHub Desktop.
Save enesozeren/b2c7b505f5a33e0948cf90f8df0f6149 to your computer and use it in GitHub Desktop.
import gpt1
from transformers import pipeline
gpt = pipeline('text-generation', model='openai-gpt')
prompt = "Once upon a time, there was a mad king"
answer = gpt(prompt, max_length=30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment