maliozer commited on
Commit
ce22bda
1 Parent(s): 13909fd

Update app.py

Browse files

update h-paramters

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -24,13 +24,13 @@ def load_model(model_name="BioGPT"):
24
  return tokenizer, model
25
 
26
 
27
- def get_beam_output(sentence, selected_model, min_len,max_len, n_beams):
28
  tokenizer, model = load_model(selected_model)
29
  inputs = tokenizer(sentence, return_tensors="pt")
30
  with torch.no_grad():
31
  beam_output = model.generate(**inputs,
32
- min_length=100,
33
- max_length=1024,
34
  num_beams=n_beams,
35
  early_stopping=True
36
  )
 
24
  return tokenizer, model
25
 
26
 
27
+ def get_beam_output(sentence, selected_model, min_len=100,max_len=512, n_beams=1):
28
  tokenizer, model = load_model(selected_model)
29
  inputs = tokenizer(sentence, return_tensors="pt")
30
  with torch.no_grad():
31
  beam_output = model.generate(**inputs,
32
+ min_length=min_len,
33
+ max_length=max_len,
34
  num_beams=n_beams,
35
  early_stopping=True
36
  )