Downloads · 30 days
0
Kush26/rhapsody-84m-haiku-poet
rhapsody-84m-haiku-poet is a text generation model from Kush26. Use it when you need the model to write or continue text. The card lists the license as mit.
Rhapsody Constraint Poet is an 84-million parameter Transformer language model fine-tuned to generate structured, topic-constrained 5-7-5 haikus.
Downloads · 30 days
0
Access
Public
Updated Jun 26, 2026
Repo size
219 MB
Likes
0
Public
Click a slice to open those files.
.safetensors219 MB · 100%
From the Hugging Face model README
Rhapsody Constraint Poet is an 84-million parameter Transformer language model fine-tuned to generate structured, topic-constrained 5-7-5 haikus.
It is fine-tuned from the base Rhapsody TextLM (84M) on a subset of the taucris/haiku_333K dataset.
Rhapsody TextLM (84M base)The model was fine-tuned for sequence-to-sequence style prompt-response generation:
Write a haiku about {topic}.\n{haiku_line_1}\n{haiku_line_2}\n{haiku_line_3}<|endoftext|>taucris/haiku_333K dataset.labels[t] = input_ids[t+1]), with prompt tokens and padding fully masked out (-100) so the model only computes loss on the poem contents and the final <|endoftext|> token.Evaluated on 50 test samples from the taucris/haiku_333K validation set:
You can run interactive generation locally using the model checkpoint:
import torch
from rhapsody.inference import load_model, generate_text
from rhapsody.data import get_tokenizer
device = "cuda" if torch.cuda.is_available() else "cpu"
# Load model and tokenizer
model_path = "outputs_poet/poet_model.safetensors"
model = load_model(model_path, device=device)
tokenizer = get_tokenizer(symbolic=False)
# Define your custom topic
topic = "lonely night"
prompt = f"Write a haiku about {topic}.\n"
# Autoregressive generation
completion = generate_text(
model=model,
tokenizer=tokenizer,
prompt=prompt,
max_new_tokens=40,
temperature=0.7,
repetition_penalty=1.15,
device=device
)
print(completion.strip())
Topic: lonely night
stars shine in the dark
their light a beacon of hope
night's lonely plea
(Syllables: 5-7-5)
Topic: delhi
the chefs knife slices
delhi's tender flesh and crust
flavors on the plate
(Syllables: 5-7-5)
Topic: new york
old york's rusted gate
creaks but never breaks the night
history's hold tight
(Syllables: 5-7-5)