book_reviews / app.py
shainis's picture
Upload app.py
e28289d
raw
history blame
605 Bytes
import gradio as gr
learn = load_learner('export.pkl')
def reviews_generator(text,n_words):
preds = lean.predict(text, n_words)
return outputs
examples = [["The beauty of this books", "45"], ["I didn't like this book because", "30"]]
demo = gr.Interface(fn=reviews_generator,
inputs=[gr.Textbox(lines=2, placeholder="Enter the beginning of the book review here", label="Sample text"), gr.Textbox(lines=1, label="Length of generated text")],
outputs=[gr.Textbox(label="Sample text")],
examples=examples)
demo.launch( debug = True )