Балаганский Никита Николаевич
commited on
Commit
•
53cf441
1
Parent(s):
333ca76
fix
Browse files
app.py
CHANGED
@@ -86,11 +86,12 @@ def inference(
|
|
86 |
lm_tokenizer = transformers.AutoTokenizer.from_pretrained(lm_model_name)
|
87 |
if alpha != 0:
|
88 |
caif_sampler = load_sampler(cls_model_name=cls_model_name, lm_tokenizer=lm_tokenizer)
|
|
|
|
|
89 |
else:
|
90 |
caif_sampler = None
|
91 |
entropy_threshold = None
|
92 |
-
|
93 |
-
entropy_threshold = None
|
94 |
generator.set_caif_sampler(caif_sampler)
|
95 |
ordinary_sampler = TopKWithTemperatureSampler()
|
96 |
kwargs = {
|
|
|
86 |
lm_tokenizer = transformers.AutoTokenizer.from_pretrained(lm_model_name)
|
87 |
if alpha != 0:
|
88 |
caif_sampler = load_sampler(cls_model_name=cls_model_name, lm_tokenizer=lm_tokenizer)
|
89 |
+
if entropy_threshold < 0.05:
|
90 |
+
entropy_threshold = None
|
91 |
else:
|
92 |
caif_sampler = None
|
93 |
entropy_threshold = None
|
94 |
+
|
|
|
95 |
generator.set_caif_sampler(caif_sampler)
|
96 |
ordinary_sampler = TopKWithTemperatureSampler()
|
97 |
kwargs = {
|