MCPcopy Create free account
hub / github.com/THUDM/GLM / get_output_func

Function get_output_func

tasks/superglue/dataset.py:48–57  ·  view source on GitHub ↗
(task_name, args)

Source from the content-addressed store, hash-verified

46
47
48def get_output_func(task_name, args):
49 def default_output_func(predictions, examples, output_file):
50 with open(output_file, "w") as output:
51 for prediction, example in zip(predictions, examples):
52 data = {"idx": example["idx"], "label": prediction}
53 output.write(json.dumps(data) + "\n")
54 if task_name in PROCESSORS:
55 return PROCESSORS[task_name](args).output_prediction
56 else:
57 return default_output_func
58
59
60def read_tsv(path, **kwargs):

Callers 1

metrics_func_providerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected