2 Commits

Author SHA1 Message Date
1087651663 Optimized program with code 2025-12-27 19:59:14 -08:00
71b7d59419 Optimized program with code 2025-12-27 19:47:32 -08:00
3 changed files with 8 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
{ {
"model": "openrouter/openai/gpt-4o", "model": "openrouter/openai/gpt-4o",
"max_tokens": 1024 "max_tokens": 1024,
"cache": true
} }

View File

@@ -27,6 +27,7 @@ class CypherFromQuestion(dspy.Signature):
class GenerateCypherConfig(PrecompiledConfig): class GenerateCypherConfig(PrecompiledConfig):
model: str = "openrouter/openai/gpt-4o" # OPENROUTER ONLY model: str = "openrouter/openai/gpt-4o" # OPENROUTER ONLY
max_tokens: int = 1024 max_tokens: int = 1024
cache: bool = True
class GenerateCypher(PrecompiledProgram): class GenerateCypher(PrecompiledProgram):
@@ -38,6 +39,7 @@ class GenerateCypher(PrecompiledProgram):
model=config.model, model=config.model,
max_tokens=config.max_tokens, max_tokens=config.max_tokens,
api_base="https://openrouter.ai/api/v1", api_base="https://openrouter.ai/api/v1",
cache=config.cache,
) )
self.generate_cypher = dspy.ChainOfThought(CypherFromQuestion) self.generate_cypher = dspy.ChainOfThought(CypherFromQuestion)
self.generate_cypher.set_lm(self.lm) self.generate_cypher.set_lm(self.lm)
@@ -69,6 +71,6 @@ if __name__ == "__main__":
generate_cypher.push_to_hub( generate_cypher.push_to_hub(
"farouk1/text-to-cypher", "farouk1/text-to-cypher",
with_code=True, with_code=True,
tag="v0.0.9", tag="v1.0.1",
commit_message="Update README.md", commit_message="Don't cache results",
) )

View File

@@ -61,7 +61,7 @@ train_set, val_set, test_set = process_dataset()
optimizer = GEPA( optimizer = GEPA(
metric=metric, metric=metric,
auto="light", auto="medium",
num_threads=32, num_threads=32,
track_stats=True, track_stats=True,
reflection_minibatch_size=3, reflection_minibatch_size=3,
@@ -75,4 +75,4 @@ if __name__ == "__main__":
trainset=train_set, trainset=train_set,
valset=val_set, valset=val_set,
) )
optimized_program.push_to_hub("farouk1/text-to-cypher-gepa", tag="v1.0.1", commit_message="Optimized program with code") optimized_program.push_to_hub("farouk1/text-to-cypher-gepa", tag="v1.0.4", commit_message="Optimized program with code")