diff --git a/optimize.py b/optimize.py index 5cfcaaf..c1d066d 100644 --- a/optimize.py +++ b/optimize.py @@ -33,6 +33,7 @@ def classification_metric( if __name__ == "__main__": + program = DocExtract.from_precompiled("tyrin/doc-extract") dspy.configure(lm=dspy.LM("openai/gpt-4.1-mini", temperature=0.0)) optimized_program = dspy.GEPA( @@ -40,7 +41,7 @@ if __name__ == "__main__": reflection_lm=dspy.LM("openai/gpt-4.1-mini", temperature=1.0, max_tokens=8000), auto="light", ).compile( - DocExtract(), + program, trainset=load_dataset("data/train.jsonl"), valset=load_dataset("data/val.jsonl"), ) diff --git a/program.py b/program.py index 9613d5a..31caa37 100644 --- a/program.py +++ b/program.py @@ -25,4 +25,5 @@ class DocExtract(PrecompiledProgram): return self.cot(context=context) -DocExtract().push_to_hub("tyrin/doc-extract") +if __name__ == "__main__": + DocExtract().push_to_hub("tyrin/doc-extract")