Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -519,7 +519,9 @@ def main(input_text, max_new_tokens):
|
|
519 |
max_new_tokens=max_new_tokens, context_size=context_size,
|
520 |
top_k=25, temperature=1.4, text_to_token_ids=text_to_token_ids, tokenizer=tokenizer
|
521 |
)
|
522 |
-
|
|
|
|
|
523 |
|
524 |
# if __name__ == "__main__":
|
525 |
# gr.Interface(fn=main, inputs=[gr.Textbox(label='Starting context'), gr.Number(label="Maximum output tokens")], outputs=[gr.Textbox(label="Response:")], title="CatGPT", article="Meow").launch()
|
|
|
519 |
max_new_tokens=max_new_tokens, context_size=context_size,
|
520 |
top_k=25, temperature=1.4, text_to_token_ids=text_to_token_ids, tokenizer=tokenizer
|
521 |
)
|
522 |
+
new_thing = re.sub(".", ". Meow.", token_ids)
|
523 |
+
# return tokenizer.decode(token_ids.squeeze(0).tolist())
|
524 |
+
return tokenizer.decode(new_thing.squeeze(0).tolist())
|
525 |
|
526 |
# if __name__ == "__main__":
|
527 |
# gr.Interface(fn=main, inputs=[gr.Textbox(label='Starting context'), gr.Number(label="Maximum output tokens")], outputs=[gr.Textbox(label="Response:")], title="CatGPT", article="Meow").launch()
|