Spaces:
Sleeping
Sleeping
Add show_progress_bar parameter
Browse files- README.md +1 -0
- blanc_score.py +5 -1
README.md
CHANGED
@@ -56,6 +56,7 @@ Args:
|
|
56 |
- `random_seed` (_int, optional_): Random seed for Python and PyTorch. Default is `0`.
|
57 |
- `inference_batch_size` (_int, optional_): Batch size for inference. Default is `1`.
|
58 |
- `inference_mask_evenly` (_bool, optional_): Whether to mask every `gap` tokens during inference (`True`) or mask randomly with a probability of 0.15 (`False`). Default is `True`.
|
|
|
59 |
|
60 |
BLANC-help specific arguments:
|
61 |
- `filler_token` (_str, optional_): Token to use as filler in lieu of the summary. Default is `.`.
|
|
|
56 |
- `random_seed` (_int, optional_): Random seed for Python and PyTorch. Default is `0`.
|
57 |
- `inference_batch_size` (_int, optional_): Batch size for inference. Default is `1`.
|
58 |
- `inference_mask_evenly` (_bool, optional_): Whether to mask every `gap` tokens during inference (`True`) or mask randomly with a probability of 0.15 (`False`). Default is `True`.
|
59 |
+
- `show_progress_bar` (_bool, optional_): Whether to display a progress bar during computation. Default is `True`.
|
60 |
|
61 |
BLANC-help specific arguments:
|
62 |
- `filler_token` (_str, optional_): Token to use as filler in lieu of the summary. Default is `.`.
|
blanc_score.py
CHANGED
@@ -37,7 +37,8 @@ Args:
|
|
37 |
random_seed (int, optional): Random seed for Python and PyTorch. Default is 0.
|
38 |
inference_batch_size (int, optional): Batch size for inference. Default is 1.
|
39 |
inference_mask_evenly (bool, optional): Whether to mask every `gap` tokens during inference (True) or mask randomly with a probability of 0.15 (False). Default is True.
|
40 |
-
|
|
|
41 |
BLANC-help specific arguments:
|
42 |
filler_token (str, optional): Token to use as filler in lieu of the summary. Default is ".".
|
43 |
help_sep (str, optional): Token used to separate the summary (or filler) from the sentence, or '' for no separator. Default is "".
|
@@ -132,6 +133,7 @@ class BLANC(evaluate.Metric):
|
|
132 |
finetune_chunk_stride=32,
|
133 |
learning_rate=5e-05,
|
134 |
warmup_steps=0,
|
|
|
135 |
):
|
136 |
# Choose between BLANC-help and BLANC-tune methods based on measure argument.
|
137 |
if blanc_score == "help":
|
@@ -152,6 +154,7 @@ class BLANC(evaluate.Metric):
|
|
152 |
inference_mask_evenly=inference_mask_evenly,
|
153 |
filler_token=filler_token,
|
154 |
help_sep=help_sep,
|
|
|
155 |
)
|
156 |
elif blanc_score == "tune":
|
157 |
blanc_instance = BlancTune(
|
@@ -177,6 +180,7 @@ class BLANC(evaluate.Metric):
|
|
177 |
finetune_chunk_stride=finetune_chunk_stride,
|
178 |
learning_rate=learning_rate,
|
179 |
warmup_steps=warmup_steps,
|
|
|
180 |
)
|
181 |
else:
|
182 |
raise ValueError(f"Invalid measure argument: {measure}. Choose 'help' or 'tune'.")
|
|
|
37 |
random_seed (int, optional): Random seed for Python and PyTorch. Default is 0.
|
38 |
inference_batch_size (int, optional): Batch size for inference. Default is 1.
|
39 |
inference_mask_evenly (bool, optional): Whether to mask every `gap` tokens during inference (True) or mask randomly with a probability of 0.15 (False). Default is True.
|
40 |
+
show_progress_bar (bool, optional): Whether to show progress bars during evaluation. Default is True.
|
41 |
+
|
42 |
BLANC-help specific arguments:
|
43 |
filler_token (str, optional): Token to use as filler in lieu of the summary. Default is ".".
|
44 |
help_sep (str, optional): Token used to separate the summary (or filler) from the sentence, or '' for no separator. Default is "".
|
|
|
133 |
finetune_chunk_stride=32,
|
134 |
learning_rate=5e-05,
|
135 |
warmup_steps=0,
|
136 |
+
show_progress_bar=True,
|
137 |
):
|
138 |
# Choose between BLANC-help and BLANC-tune methods based on measure argument.
|
139 |
if blanc_score == "help":
|
|
|
154 |
inference_mask_evenly=inference_mask_evenly,
|
155 |
filler_token=filler_token,
|
156 |
help_sep=help_sep,
|
157 |
+
show_progress_bar=show_progress_bar,
|
158 |
)
|
159 |
elif blanc_score == "tune":
|
160 |
blanc_instance = BlancTune(
|
|
|
180 |
finetune_chunk_stride=finetune_chunk_stride,
|
181 |
learning_rate=learning_rate,
|
182 |
warmup_steps=warmup_steps,
|
183 |
+
show_progress_bar=show_progress_bar,
|
184 |
)
|
185 |
else:
|
186 |
raise ValueError(f"Invalid measure argument: {measure}. Choose 'help' or 'tune'.")
|