File size: 550 Bytes
baf0d49 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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() |