Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
pipeline_flan=pipeline(model="google/flan-t5-xl") | |
def generatellm(text): | |
output_flan = pipeline_flan(text, max_length=100)[0]["generated_text"] | |
return output_flan | |
gradio_ui= gr.Interface( | |
fn=translate, | |
title="Translation Demo", | |
inputs= gr.components.Textbox(label="Enter your text"), | |
outputs=gr.outputs.Textbox(label="Results") | |
) | |
gradio_ui.launch() |