Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -27,8 +27,6 @@ def clean_text(url):
|
|
27 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
28 |
print ("device ",device)
|
29 |
|
30 |
-
beams = gr.Slider(label="Number of Beams", minimum=1, maximum=20, step=1, randomize=True, type="value", default=1, optional=False)
|
31 |
-
|
32 |
# Diverse Beam search
|
33 |
def my_paraphrase(sentence, model, tokenizer,beams):
|
34 |
|
@@ -68,7 +66,8 @@ def return_output(file, models,beams):
|
|
68 |
return new_output
|
69 |
|
70 |
demo = gr.Interface(return_output, inputs=[gr.inputs.Textbox(label="Text", optional=False),
|
71 |
-
gr.inputs.Dropdown(['Pegasus', 'T5'], type="value", default=None, label="Models", optional=False),
|
|
|
72 |
outputs=[gr.outputs.Textbox(label="Summary")])
|
73 |
|
74 |
if __name__ == "__main__":
|
|
|
27 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
28 |
print ("device ",device)
|
29 |
|
|
|
|
|
30 |
# Diverse Beam search
|
31 |
def my_paraphrase(sentence, model, tokenizer,beams):
|
32 |
|
|
|
66 |
return new_output
|
67 |
|
68 |
demo = gr.Interface(return_output, inputs=[gr.inputs.Textbox(label="Text", optional=False),
|
69 |
+
gr.inputs.Dropdown(['Pegasus', 'T5'], type="value", default=None, label="Models", optional=False),
|
70 |
+
gr.Slider(label="Number of Beams", minimum=1, maximum=20, step=1, randomize=True, type="value", default=1, optional=False)],
|
71 |
outputs=[gr.outputs.Textbox(label="Summary")])
|
72 |
|
73 |
if __name__ == "__main__":
|