text-api / app.py
yxccai's picture
Upload 2 files
1ce8509 verified
raw
history blame
305 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("text2text-generation", model="yxccai/text-style")
def chat(input_text):
result = pipe(input_text, max_new_tokens=512)[0]["generated_text"]
return result
gr.Interface(fn=chat, inputs="text", outputs="text").launch()