|
import gradio as gr |
|
from transformers import pipeline |
|
|
|
|
|
pipe_gpt = pipeline("text-generation", model="FreedomIntelligence/Apollo-0.5B", trust_remote_code=True) |
|
|
|
def generate_text(input_text): |
|
output = pipe_gpt(input_text, max_length=500) |
|
return output[0]["generated_text"] |
|
|
|
|
|
iface = gr.Interface(fn=generate_text, |
|
inputs=gr.Textbox(lines=5, placeholder="Type your prompt here..."), |
|
outputs="text", |
|
title="Text Generation with Apollo-0.5B", |
|
description="Enter some text to see how Apollo-0.5B continues it.") |
|
|
|
|
|
iface.launch() |