Views
No views yet
1from transformers import pipeline
2
3pipe = pipeline(
4 "text-generation",
5 model="mzen/EventModel-1.2B",
6 trust_remote_code=True,
7 device_map="auto"
8)
9
10prompt = "### Character: 13 year old, boy\n\n### Problem:"
11
12output = pipe(
13 prompt,
14 max_new_tokens=512,
15 do_sample=True,
16 temperature=0.7,
17 top_p=0.9,
18 return_full_text=False
19)
20
21print(output[0]['generated_text'])1@misc{vonwerra2022trl,
2 title = {{TRL: Transformer Reinforcement Learning}},
3 author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
4 year = 2020,
5 journal = {GitHub repository},
6 publisher = {GitHub},
7 howpublished = {\url{https://github.com/huggingface/trl}}
8}