Views
No views yet
distilbert/distilgpt21from transformers import pipeline
2
3model_name = "Susant-Achary/distilgpt2-constitution-of-india"
4
5gen_pipeline = pipeline(
6 "text-generation",
7 model=model_name,
8 tokenizer=model_name
9)
10
11prompt = "We, the people of India"
12output = gen_pipeline(
13 prompt,
14 max_length=100,
15 do_sample=True,
16 temperature=0.8,
17 top_k=100,
18 top_p=0.95,
19 num_return_sequences=1
20)
21
22print(output[0]['generated_text'])