Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
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=
|
|
|
|
|
|
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 |
+
|