Spaces:
Sleeping
Sleeping
update
Browse files
main.py
CHANGED
@@ -168,7 +168,6 @@ def waka(preface: str = "", author: str = "", first_line: str = "γγγγ¬γ¨
|
|
168 |
Prompt: {waka_prompt}<br>
|
169 |
Max New Tokens: {max_new_tokens}<br>
|
170 |
"""
|
171 |
-
yield info + "Generating Poem..."
|
172 |
generated = __generate(wakagpt_tokenizer, wakagpt_model, waka_prompt, do_sample, num_beams, num_beam_groups, max_new_tokens, temperature, top_k, top_p, repetition_penalty, num_return_sequences)
|
173 |
|
174 |
removed = 0
|
@@ -188,7 +187,7 @@ def waka(preface: str = "", author: str = "", first_line: str = "γγγγ¬γ¨
|
|
188 |
checked_generated = [first_line + i[len(waka_prompt) - 1:] for i in generated]
|
189 |
|
190 |
generated = [f"<p>{i}</p>" for i in checked_generated]
|
191 |
-
|
192 |
|
193 |
|
194 |
if __name__ == "__main__":
|
|
|
168 |
Prompt: {waka_prompt}<br>
|
169 |
Max New Tokens: {max_new_tokens}<br>
|
170 |
"""
|
|
|
171 |
generated = __generate(wakagpt_tokenizer, wakagpt_model, waka_prompt, do_sample, num_beams, num_beam_groups, max_new_tokens, temperature, top_k, top_p, repetition_penalty, num_return_sequences)
|
172 |
|
173 |
removed = 0
|
|
|
187 |
checked_generated = [first_line + i[len(waka_prompt) - 1:] for i in generated]
|
188 |
|
189 |
generated = [f"<p>{i}</p>" for i in checked_generated]
|
190 |
+
return info + f"Removed Malformed: {removed}<br>Results:<br>{''.join(generated)}"
|
191 |
|
192 |
|
193 |
if __name__ == "__main__":
|