import gradio as gr from transformers import pipeline import tensorflow text2text_generator = pipeline("text2text-generation") def main(input): return text2text_generator("question: " + input + " context: 42 is the answer to life, the universe and everything") iface = gr.Interface(fn=main, inputs="text", outputs="text") iface.launch()