|
import gradio as gr |
|
import time |
|
|
|
|
|
model = gr.Interface.load("models/roneneldan/TinyStories-Instruct-33M") |
|
|
|
|
|
additional_input = gr.inputs.Textbox(label="Input Text", placeholder="Enter your story here...") |
|
additional_output = gr.outputs.Textbox(label="Generated Story") |
|
|
|
|
|
def typing_effect(text): |
|
for char in text: |
|
print(char, end='', flush=True) |
|
time.sleep(0.05) |
|
print() |
|
|
|
|
|
model.launch(inputs=additional_input, outputs=additional_output, title="Tiny Stories Generator", |
|
description="This model generates creative stories based on the input text provided.", |
|
examples=[["Once upon a time..."]], |
|
live=False, |
|
fn=typing_effect) |
|
|