Luigi commited on
Commit
c6bc247
·
1 Parent(s): ab41c65

auto-adjust num_beam_groups to the greatest divisor of m

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -80,6 +80,7 @@ def suggest_next(text, model_name, k, m, num_beam_groups, diversity_penalty):
80
  "early_stopping": True,
81
  }
82
  if diversity_penalty and diversity_penalty > 0:
 
83
  gen_kwargs["num_beam_groups"] = num_beam_groups
84
  gen_kwargs["diversity_penalty"] = float(diversity_penalty)
85
 
 
80
  "early_stopping": True,
81
  }
82
  if diversity_penalty and diversity_penalty > 0:
83
+ valid_group = gcd(m, num_beam_groups)
84
  gen_kwargs["num_beam_groups"] = num_beam_groups
85
  gen_kwargs["diversity_penalty"] = float(diversity_penalty)
86