Spaces:
Sleeping
Sleeping
import gradio as gr | |
import torch | |
from s19_cpu_gradio_2 import GPT | |
def sentence_builder(txt, new_tokens): | |
if(None == new_tokens): | |
new_tokens = 0 | |
out = GPT(txt, int(new_tokens)) | |
return out | |
demo = gr.Interface( | |
sentence_builder, | |
[ | |
gr.Textbox("", label = "Input", info="mandatory input"), | |
gr.Dropdown( | |
["100", "200", "300", "400", "500", "1000", "2000"], label="New Tokens", info="Choose how many tokens required in output." | |
) | |
], | |
[ | |
gr.Textbox("", label = "Output") | |
] | |
) | |
demo.launch(debug=True) | |