Text-generator / app.py
TekamBrice's picture
Create app.py
74a44c4 verified
raw
history blame contribute delete
325 Bytes
import gradio as gr
import transformers
from transformers import pipeline
generator=pipeline('text-generation',model='microsoft/phi-2')
def get_textgeneration(text):
texte=generator(text)
return texte[0]['generated_text']
inter=gr.Interface(get_textgeneration,title='text generator',inputs='text',outputs='text').launch()