Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ def generate_random_poem(num_lines=4, max_length=150, temperature=1.0, top_p=0.9
|
|
60 |
random_line = random.choice(dataset["poem"])
|
61 |
|
62 |
# Prepare the input text with the random line selected, and start with a unique phrase to avoid repetition
|
63 |
-
input_text = f"
|
64 |
|
65 |
# Tokenize the input text
|
66 |
encoding = tokenizer(input_text, return_tensors="pt", padding=True, truncation=True, max_length=max_length)
|
|
|
60 |
random_line = random.choice(dataset["poem"])
|
61 |
|
62 |
# Prepare the input text with the random line selected, and start with a unique phrase to avoid repetition
|
63 |
+
input_text = f"{random_line} " # Unique start to force variety
|
64 |
|
65 |
# Tokenize the input text
|
66 |
encoding = tokenizer(input_text, return_tensors="pt", padding=True, truncation=True, max_length=max_length)
|