Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -82,14 +82,7 @@ def generate_random_poem(prompt, max_length=150, temperature=1.0, top_p=0.9, num
|
|
82 |
# Split the generated text into separate lines based on full stops (Hindi poems often end with "।")
|
83 |
poem_lines = generated_poem.split("।")
|
84 |
|
85 |
-
|
86 |
-
if len(poem_lines) < num_lines:
|
87 |
-
while len(poem_lines) < num_lines:
|
88 |
-
# If not enough lines, add more content from the dataset
|
89 |
-
random_line = random.choice(dataset["poem"])
|
90 |
-
poem_lines.append(random_line.strip())
|
91 |
-
|
92 |
-
poem_lines = poem_lines[:num_lines]
|
93 |
|
94 |
final_poem = "\n".join(poem_lines)
|
95 |
|
|
|
82 |
# Split the generated text into separate lines based on full stops (Hindi poems often end with "।")
|
83 |
poem_lines = generated_poem.split("।")
|
84 |
|
85 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
final_poem = "\n".join(poem_lines)
|
88 |
|