| prompts = [ | |
| "Once upon a time", | |
| "Lucy had a red ball.", | |
| "Tom and Jane were friends.", | |
| "A little cat wanted", | |
| ] | |
| for p in prompts: | |
| inputs = tokenizer(p, return_tensors="pt").to(model.device) | |
| outputs = model.generate( | |
| **inputs, | |
| max_new_tokens=80, | |
| temperature=0.7, | |
| top_p=0.9, | |
| repetition_penalty=1.15, | |
| do_sample=True, | |
| ) | |
| print("\nPROMPT:", p) | |
| print(tokenizer.decode(outputs[0], skip_special_tokens=True)) |