Commit 81317ad4 authored by Baber Abbasi's avatar Baber Abbasi
Browse files

feat: allow `unconditional_context` in config to be set for acc_mutual_info...

feat: allow `unconditional_context` in config to be set for acc_mutual_info (default is empty string -> EOS/BOS)
parent cf36afcd
Pipeline #2987 failed with stages
in 0 seconds
...@@ -96,6 +96,7 @@ class TaskConfig(dict): ...@@ -96,6 +96,7 @@ class TaskConfig(dict):
should_decontaminate: bool = False should_decontaminate: bool = False
doc_to_decontamination_query: Optional[str] = None doc_to_decontamination_query: Optional[str] = None
gen_prefix: Optional[str] = None gen_prefix: Optional[str] = None
unconditional_context: str = ""
metadata: Optional[dict] = ( metadata: Optional[dict] = (
None # by default, not used in the code. allows for users to pass arbitrary info to tasks None # by default, not used in the code. allows for users to pass arbitrary info to tasks
) )
...@@ -1483,7 +1484,7 @@ class ConfigurableTask(Task): ...@@ -1483,7 +1484,7 @@ class ConfigurableTask(Task):
# in other words normalizing by subtracting the unconditional logprob of each choice. # in other words normalizing by subtracting the unconditional logprob of each choice.
# TODO: should these be strided? will have to modify the processing in process_results if so # TODO: should these be strided? will have to modify the processing in process_results if so
aux_arguments = [ aux_arguments = [
("", f"{target_delimiter}{choice}") for choice in choices (self.config.unconditional_context, f"{target_delimiter}{choice}") for choice in choices
] ]
arguments.extend(aux_arguments) arguments.extend(aux_arguments)
......
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