import gradio as gr import transformers from transformers import pipeline generator=pipeline('text-generation',model='microsoft/phi-2') generator('Hello i am an artificial intelligence engineer',max_length=40) def Get_GenerationText(input_text): result= generator(input_text) return result[0]['generated_text'] iface=gr.Interface(fn=Get_GenerationText, title='Generation Text', inputs='text', outputs='text', description='Get Text Generation of giving input').launch()