shainis commited on
Commit
e28289d
1 Parent(s): e19f54b

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ learn = load_learner('export.pkl')
4
+
5
+ def reviews_generator(text,n_words):
6
+ preds = lean.predict(text, n_words)
7
+ return outputs
8
+
9
+ examples = [["The beauty of this books", "45"], ["I didn't like this book because", "30"]]
10
+
11
+ demo = gr.Interface(fn=reviews_generator,
12
+ 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")],
13
+ outputs=[gr.Textbox(label="Sample text")],
14
+ examples=examples)
15
+ demo.launch( debug = True )