1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3tokenizer = AutoTokenizer.from_pretrained("gabrielloiseau/TAROT-DPO")
4model = AutoModelForCausalLM.from_pretrained("gabrielloiseau/TAROT-DPO")
5
6paragraph = """I had dinner at Bella's Bistro last night, and it was a delightful experience.
7As soon as I walked in, I was greeted warmly by the hostess, and the cozy, rustic decor made me feel right at home.
8I started with the bruschetta, which was so fresh and flavorful—I could have eaten a whole meal of just that!"""
9
10inputs = tokenizer([paragraph + "<|endoftext|>"], return_tensors="pt", padding=True)
11outputs = model.generate(**inputs, do_sample=True, max_new_tokens=128)
12
13outputs = outputs[:, inputs["input_ids"].shape[1]:]
14tokenizer.batch_decode(outputs,skip_special_tokens=True)