Spaces:
Running
on
Zero
Running
on
Zero
auto-adjust num_beam_groups to the greatest divisor of m
Browse files
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 |
|