Python, Data Science, AI, NLP, Programming.
generate(prompt): return generator(prompt, max_length=50)[0]["generated_text"] iface = gr.Interface(fn=generate, inputs="text", outputs="text") iface.launch() This app takes in a text prompt, passes it to the GPT-2 model to generate a continuation, and returns the generated text. Simple, but