shainis commited on
Commit
b6f165e
1 Parent(s): 94365b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -7,10 +7,13 @@ def reviews_generator(text,n_words):
7
  preds = learn.predict(text, n_words)
8
  return outputs
9
 
10
- examples = [["The beauty of this books", "45"], ["I didn't like this book because", "30"]]
11
 
12
- demo = gr.Interface(fn=reviews_generator,
13
- 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")],
14
- outputs=[gr.Textbox(label="Sample text")],
15
- examples=examples)
16
- demo.launch( debug = True )
 
 
 
 
7
  preds = learn.predict(text, n_words)
8
  return outputs
9
 
10
+ examples = [["The beauty of this book", "45"], ["I did not like this book because", "30"]]
11
 
12
+ gr.Interface(fn = reviews_generator,
13
+ title = "Book reviews generator",
14
+ description = "Type the beginning of a review, and the machine will generate a full review.",
15
+ inputs = [gr.Textbox(lines=1, placeholder="Enter the beginning of the review here", label="Starter text"),
16
+ gr.Slider(0, 100, label="Length of desired review")],
17
+ outputs = gr.outputs.Textbox(label="Generated Text"),
18
+ examples = examples
19
+ ).launch(share=True)