Commit e2bfdf3b authored by lintangsutawika's avatar lintangsutawika
Browse files

add weight_by_size config

parent 45a8f709
...@@ -80,6 +80,7 @@ class TaskConfig(dict): ...@@ -80,6 +80,7 @@ class TaskConfig(dict):
filter_list: Union[str, list] = None filter_list: Union[str, list] = None
should_decontaminate: bool = False should_decontaminate: bool = False
doc_to_decontamination_query: str = None doc_to_decontamination_query: str = None
weight_by_size: bool = False
metadata: Union[ metadata: Union[
str, list str, list
......
...@@ -123,7 +123,7 @@ def simple_evaluate( ...@@ -123,7 +123,7 @@ def simple_evaluate(
for task_name in task_dict.keys(): for task_name in task_dict.keys():
task_obj = task_dict[task_name] task_obj = task_dict[task_name]
if type(task_obj) == tuple: if type(task_obj) == tuple:
group, task_obj = task_obj _, task_obj = task_obj
if task_obj is None: if task_obj is None:
continue continue
...@@ -484,12 +484,11 @@ def evaluate( ...@@ -484,12 +484,11 @@ def evaluate(
if "alias" in metrics: if "alias" in metrics:
metrics.pop("alias") metrics.pop("alias")
current_size = metrics.pop("samples") if configs[task]["weight_by_size"]:
# TODO: There should be a way for users current_size = metrics.pop("samples")
# to toggle between weighted and else:
# unweighted averaging metrics.pop("samples")
# For unweighted averaging, use: current_size = 1
# current_size = 1
all_stderr = [] all_stderr = []
for metric in [ for metric in [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment