From 051376c28633b27e1fe8be990a04202bc3071e5d Mon Sep 17 00:00:00 2001 From: Tyrin Todd Date: Thu, 2 Apr 2026 18:15:47 -0700 Subject: [PATCH] (no commit message) --- optimize.py | 3 ++- program.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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")