Views
No views yet
Prompt:
O gentle moon, whose silver beams do lightGenerated:
O gentle moon, whose silver beams do light
The midnight stage where lonely hearts do pine,
Thou watchest all, and hast in patient sight
The weeping stars that in the heavens shine.
Thy ancient glow recalls the poet's art,
In sonnet's form my trembling mind is caught,
For thou and he are kindred, set apart,
By time and muse, by memory and thought.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "Exquisique/Shakespeare_Alike"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForCausalLM.from_pretrained(model_name)
6
7prompt = "O gentle moon, whose silver beams do light"
8inputs = tokenizer(prompt, return_tensors="pt")
9output = model.generate(
10 **inputs, max_new_tokens=128, temperature=0.9, top_p=0.95
11)
12print(tokenizer.decode(output[0], skip_special_tokens=True))