Skip to content

Commit d7f000a

Browse files
committed
Added missing filter
1 parent b57169b commit d7f000a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

examples/pbe/transduction/knowledge_graph/preprocess_tasks.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ def find_constants(
6262
)
6363
for i in iterator
6464
]
65-
best = [(sum(len(s) for s in l if l is not None), l) for l in possibles]
65+
best = [
66+
(sum(len(s) for s in filter_constants(l) if l is not None), l)
67+
for l in possibles
68+
]
6669
best.sort(reverse=True)
6770
found = best[0][1]
6871
# if has_found_constant:
@@ -141,7 +144,7 @@ def filter_constants(constants: List[str]) -> List[str]:
141144
print(f"[N°{i}] {task.metadata['name']}")
142145
print("Sample:", pbe.examples[0].output)
143146
constants = task.metadata.get("constants", None)
144-
if constants is None:
147+
if constants is None or task.metadata["name"] == "head date french.":
145148
all_possibles = [
146149
filter_constants(
147150
find_constants(

0 commit comments

Comments
 (0)