varl42 commited on
Commit
5c05bec
1 Parent(s): 859e3e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -69,7 +69,7 @@ def summarize_documents(text_input):
69
  # Tokenize input text for the model
70
  inputs = tokenizer(text_input, return_tensors="pt", truncation=True, max_length=512)
71
  # Generate a summary with the model
72
- summary_ids = model.generate(inputs['input_ids'], max_length=150, min_length=40, length_penalty=2.0, num_beams=4, early_stopping=True)
73
  summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
74
 
75
  summary = re.sub(r"(\w+)([?!])\s", r"\1\2. ", summary) # Ensures that sentences ending in ? ! .
 
69
  # Tokenize input text for the model
70
  inputs = tokenizer(text_input, return_tensors="pt", truncation=True, max_length=512)
71
  # Generate a summary with the model
72
+ summary_ids = model.generate(inputs['input_ids'], max_length=512, min_length=125, length_penalty=2.0, num_beams=4, early_stopping=True)
73
  summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
74
 
75
  summary = re.sub(r"(\w+)([?!])\s", r"\1\2. ", summary) # Ensures that sentences ending in ? ! .