Spaces:
Sleeping
Sleeping
Amitontheweb
commited on
Commit
•
18abbba
1
Parent(s):
0754c2a
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ def generate(input_text, number_steps, number_beams, number_beam_groups, diversi
|
|
36 |
top_p=top_p if top_p_flag else None,
|
37 |
top_k=top_k if top_k_flag else None,
|
38 |
no_repeat_ngram_size = no_repeat_ngram_size,
|
39 |
-
repetition_penalty = repetition_penalty if (repetition_penalty > 0) else None,
|
40 |
output_scores=False,
|
41 |
do_sample=True
|
42 |
)
|
@@ -58,7 +58,7 @@ def generate(input_text, number_steps, number_beams, number_beam_groups, diversi
|
|
58 |
length_penalty=length_penalty,
|
59 |
temperature=temperature if beam_temp_flag else None,
|
60 |
no_repeat_ngram_size = no_repeat_ngram_size,
|
61 |
-
repetition_penalty = repetition_penalty if (repetition_penalty > 0) else None,
|
62 |
early_stopping = True if early_stop_flag else False,
|
63 |
output_scores=False,
|
64 |
do_sample=True if beam_temp_flag else False
|
@@ -94,7 +94,7 @@ def generate(input_text, number_steps, number_beams, number_beam_groups, diversi
|
|
94 |
return_dict_in_generate=False,
|
95 |
length_penalty=length_penalty,
|
96 |
no_repeat_ngram_size = no_repeat_ngram_size,
|
97 |
-
repetition_penalty = repetition_penalty if (repetition_penalty > 0) else None,
|
98 |
early_stopping = True if early_stop_flag else False,
|
99 |
output_scores=False,
|
100 |
)
|
@@ -117,7 +117,7 @@ def generate(input_text, number_steps, number_beams, number_beam_groups, diversi
|
|
117 |
penalty_alpha=penalty_alpha,
|
118 |
top_k=top_k if top_k_flag else None,
|
119 |
no_repeat_ngram_size = no_repeat_ngram_size,
|
120 |
-
repetition_penalty = repetition_penalty if (repetition_penalty > 0) else None,
|
121 |
output_scores=False,
|
122 |
do_sample=True
|
123 |
)
|
@@ -418,7 +418,7 @@ with gr.Blocks() as demo:
|
|
418 |
|
419 |
## Strategies:
|
420 |
|
421 |
-
Given some text as input, a decoder-only model hunts for
|
422 |
|
423 |
Example:
|
424 |
|
|
|
36 |
top_p=top_p if top_p_flag else None,
|
37 |
top_k=top_k if top_k_flag else None,
|
38 |
no_repeat_ngram_size = no_repeat_ngram_size,
|
39 |
+
repetition_penalty = float(repetition_penalty) if (repetition_penalty > 0) else None,
|
40 |
output_scores=False,
|
41 |
do_sample=True
|
42 |
)
|
|
|
58 |
length_penalty=length_penalty,
|
59 |
temperature=temperature if beam_temp_flag else None,
|
60 |
no_repeat_ngram_size = no_repeat_ngram_size,
|
61 |
+
repetition_penalty = float(repetition_penalty) if (repetition_penalty > 0) else None,
|
62 |
early_stopping = True if early_stop_flag else False,
|
63 |
output_scores=False,
|
64 |
do_sample=True if beam_temp_flag else False
|
|
|
94 |
return_dict_in_generate=False,
|
95 |
length_penalty=length_penalty,
|
96 |
no_repeat_ngram_size = no_repeat_ngram_size,
|
97 |
+
repetition_penalty = float(repetition_penalty) if (repetition_penalty > 0) else None,
|
98 |
early_stopping = True if early_stop_flag else False,
|
99 |
output_scores=False,
|
100 |
)
|
|
|
117 |
penalty_alpha=penalty_alpha,
|
118 |
top_k=top_k if top_k_flag else None,
|
119 |
no_repeat_ngram_size = no_repeat_ngram_size,
|
120 |
+
repetition_penalty = float(repetition_penalty) if (repetition_penalty > 0) else None,
|
121 |
output_scores=False,
|
122 |
do_sample=True
|
123 |
)
|
|
|
418 |
|
419 |
## Strategies:
|
420 |
|
421 |
+
Given some text as input, a decoder-only model hunts for a continuation using various search strategies. (Whether the continuation makes sense or not is for us to determine.)
|
422 |
|
423 |
Example:
|
424 |
|