from transformers import pipeline, GPT2Tokenizer, GPT2LMHeadModel, PreTrainedTokenizerFast
checkpoint = "tripathysagar/oida-gpt"
model = GPT2LMHeadModel.from_pretrained(checkpoint)
tokenizer = PreTrainedTokenizerFast.from_pretrained(checkpoint)
generator = pipeline('text-generation', model=model, tokenizer=tokenizer, device=device)
raw_inputs = [
"ଉଭୟ ଘଟଣାରେ ପରିବାର ଲୋକ",
"ଅଫିସ ସମୟ ପରେ କୌଣସି ଉପରିସ୍ଥ",
]
inputs = tokenizer(raw_inputs, padding=True, truncation=True, return_tensors="pt")
print(inputs)
output = generator(raw_inputs, max_length=75, num_return_sequences=1, truncation=True)
print(output)