Skip to content

Commit 6bab7ee

Browse files
committed
Fixed loading of upcfg
1 parent 44c1b34 commit 6bab7ee

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

examples/pbe/model_prediction.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from synth.filter import add_dfta_constraints
2121
from synth.syntax import CFG, UCFG, ProbDetGrammar, ProbUGrammar, DSL, Type
2222
from synth.utils import load_object, save_object
23-
from synth.utils.data_storage import legacy_save_object
23+
from synth.utils.data_storage import legacy_save_object, legacy_load_object
2424

2525

2626
parser = argparse.ArgumentParser(
@@ -133,7 +133,10 @@ def produce_pcfgs(
133133
file = os.path.join(dir, f"pcfgs_{dataset_name}_{model_name}.pickle")
134134
pcfgs: Union[List[ProbDetGrammar], List[ProbUGrammar]] = []
135135
if os.path.exists(file):
136-
pcfgs = load_object(file)
136+
if constrained:
137+
pcfgs = legacy_load_object(file)
138+
else:
139+
pcfgs = load_object(file)
137140
tasks = full_dataset.tasks
138141
tasks = [
139142
t

0 commit comments

Comments
 (0)