bryanmildort commited on
Commit
9355297
·
1 Parent(s): 944aa34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -4,8 +4,9 @@ def summarize_function(notes):
4
  notes_input = tokenizer(notes, return_tensors='pt')
5
  # output = model(**notes_input)
6
  # max_length = len(output['logits'][0]) + 50
 
7
  input_ids = notes_input.input_ids
8
- gen_tokens = model.generate(input_ids, do_sample=True, temperature = 0.5, max_length=250)
9
  gen_text = tokenizer.batch_decode(gen_tokens)[0]
10
  return gen_text.replace(notes, '')
11
 
 
4
  notes_input = tokenizer(notes, return_tensors='pt')
5
  # output = model(**notes_input)
6
  # max_length = len(output['logits'][0]) + 50
7
+ max_length = len(notes.split(' ')) + 50
8
  input_ids = notes_input.input_ids
9
+ gen_tokens = model.generate(input_ids, do_sample=True, temperature = 0.5, max_length=max_length)
10
  gen_text = tokenizer.batch_decode(gen_tokens)[0]
11
  return gen_text.replace(notes, '')
12