Commit d6030e12 authored by lintangsutawika's avatar lintangsutawika
Browse files

reformat

parent db37024b
...@@ -793,7 +793,11 @@ class ConfigurableTask(Task): ...@@ -793,7 +793,11 @@ class ConfigurableTask(Task):
target_string = utils.apply_template(doc_to_target, doc) target_string = utils.apply_template(doc_to_target, doc)
if target_string.isdigit(): if target_string.isdigit():
return ast.literal_eval(target_string) return ast.literal_eval(target_string)
elif len(target_string) >= 2 and (target_string[0] == "[") and (target_string[-1] == "]"): elif (
len(target_string) >= 2
and (target_string[0] == "[")
and (target_string[-1] == "]")
):
return ast.literal_eval(target_string) return ast.literal_eval(target_string)
else: else:
return target_string return target_string
...@@ -1006,7 +1010,7 @@ class ConfigurableTask(Task): ...@@ -1006,7 +1010,7 @@ class ConfigurableTask(Task):
gold = self.doc_to_target(doc) gold = self.doc_to_target(doc)
if self._config.doc_to_choice is not None: if self._config.doc_to_choice is not None:
# If you set doc_to_choice, # If you set doc_to_choice,
# it assumes that doc_to_target returns a number. # it assumes that doc_to_target returns a number.
choices = self.doc_to_choice(doc) choices = self.doc_to_choice(doc)
gold = choices[gold] gold = choices[gold]
......
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