marcolorenzi98 commited on
Commit
751a5e2
1 Parent(s): ae058c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -301,12 +301,11 @@ def summarize_abstract(path):
301
  truncation=True,
302
  return_tensors='pt')
303
 
304
- with torch.no_grad():
305
- decoded_ids = model.generate(input_ids=encoding['input_ids'],
306
- attention_mask=encoding['attention_mask'],
307
- max_length=512,
308
- top_p=.9,
309
- do_sample=True)
310
 
311
  summary=tokenizer.decode(decoded_ids[0], skip_special_tokens=True)
312
 
 
301
  truncation=True,
302
  return_tensors='pt')
303
 
304
+ decoded_ids = model.generate(input_ids=encoding['input_ids'],
305
+ attention_mask=encoding['attention_mask'],
306
+ max_length=512,
307
+ top_p=.9,
308
+ do_sample=True)
 
309
 
310
  summary=tokenizer.decode(decoded_ids[0], skip_special_tokens=True)
311