Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -519,9 +519,11 @@ 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 |
# 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()
|
|
|
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 |
+
thingy = tokenizer.decode(token_ids.squeeze(0).tolist())
|
523 |
+
new_thingy = re.sub(".", ". Meow.", thingy)
|
524 |
# return tokenizer.decode(token_ids.squeeze(0).tolist())
|
525 |
+
# return tokenizer.decode(new_thing.squeeze(0).tolist())
|
526 |
+
return new_thingy
|
527 |
|
528 |
# if __name__ == "__main__":
|
529 |
# 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()
|