shainis commited on
Commit
fd47130
1 Parent(s): f464f78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -3,11 +3,11 @@ from fastai.text.all import *
3
 
4
  learn = load_learner('export.pkl')
5
 
6
- def reviews_generator(text,n_words):
7
  preds = learn.predict(text, n_words)
8
  return preds
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",
@@ -16,4 +16,6 @@ gr.Interface(fn = reviews_generator,
16
  gr.Slider(0, 100, label="Length of desired review")],
17
  outputs = gr.outputs.Textbox(label="Generated Text"),
18
  examples = examples
19
- ).launch(share=False)
 
 
 
3
 
4
  learn = load_learner('export.pkl')
5
 
6
+ def reviews_generator(text, n_words):
7
  preds = learn.predict(text, n_words)
8
  return preds
9
+
10
+ examples = [["The beauty of this book", 45], ["I didn't like this book because", 30]]
11
 
12
  gr.Interface(fn = reviews_generator,
13
  title = "Book reviews generator",
 
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)
20
+
21
+