Spaces:
Runtime error
Runtime error
monish updates
Browse files
app.py
CHANGED
|
@@ -9,8 +9,8 @@ model = BartForConditionalGeneration.from_pretrained(model_name)
|
|
| 9 |
def summarize(inp):
|
| 10 |
inp = inp.replace('\n','')
|
| 11 |
inp = tokenizer.encode(inp, return_tensors='pt', max_length=1024)
|
| 12 |
-
summary_ids = model.generate(inp, num_beams=4, max_length=
|
| 13 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
| 14 |
return summary
|
| 15 |
|
| 16 |
-
gr.Interface(fn=summarize, inputs=gr.inputs.Textbox(lines=7, label="
|
|
|
|
| 9 |
def summarize(inp):
|
| 10 |
inp = inp.replace('\n','')
|
| 11 |
inp = tokenizer.encode(inp, return_tensors='pt', max_length=1024)
|
| 12 |
+
summary_ids = model.generate(inp, num_beams=4, max_length=1500, early_stopping=True)
|
| 13 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
| 14 |
return summary
|
| 15 |
|
| 16 |
+
gr.Interface(fn=summarize, inputs=gr.inputs.Textbox(lines=7, label="Enter Your Scene"), outputs="text").launch(inline=False)
|