Skip to content

Commit 27b6f29

Browse files
bluebreadclaude
andcommitted
Fix novelty feature bugs and update test configuration
- Fix novelty check in database.py to pass program.id instead of program object - Fix missing self parameter in embedding.py _get_client_model method - Fix serialization error by clearing novelty_llm before config deepcopy - Update function_minimization config for testing with different models 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent c925fe1 commit 27b6f29

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

examples/function_minimization/config.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# Configuration for function minimization example
2-
max_iterations: 50
2+
max_iterations: 10
33
checkpoint_interval: 5
44

55
# LLM configuration
66
llm:
7-
primary_model: "gemini-2.5-flash-lite"
7+
# primary_model: "gemini-2.5-flash-lite"
8+
primary_model: "gpt-5-mini"
89
# primary_model: "llama3.1-8b"
910
primary_model_weight: 0.8
10-
secondary_model: "gemini-2.5-flash"
11+
# secondary_model: "gemini-2.5-flash"
1112
# secondary_model: "llama-4-scout-17b-16e-instruct"
13+
secondary_model: "gpt-5-nano"
1214
secondary_model_weight: 0.2
13-
api_base: "https://generativelanguage.googleapis.com/v1beta/openai/"
15+
# api_base: "https://generativelanguage.googleapis.com/v1beta/openai/"
1416
# api_base: "https://api.cerebras.ai/v1"
17+
api_base: "https://api.openai.com/v1"
1518
temperature: 0.7
1619
max_tokens: 16000
1720
timeout: 120

openevolve/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def add(
251251
island_idx = island_idx % len(self.islands) # Ensure valid island
252252

253253
# Novelty check before adding
254-
if not self._is_novel(program, island_idx):
254+
if not self._is_novel(program.id, island_idx):
255255
logger.debug(f"Program {program.id} failed in novelty check and won't be added in the island {island_idx}")
256256
return program.id # Do not add non-novel program
257257

openevolve/embedding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(
3838
"""
3939
self.client, self.model = self._get_client_model(model_name)
4040

41-
def _get_client_model(model_name: str) -> tuple[openai.OpenAI, str]:
41+
def _get_client_model(self, model_name: str) -> tuple[openai.OpenAI, str]:
4242
if model_name in OPENAI_EMBEDDING_MODELS:
4343
client = openai.OpenAI()
4444
model_to_use = model_name

openevolve/process_parallel.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ def __init__(self, config: Config, evaluation_file: str, database: ProgramDataba
295295
def _serialize_config(self, config: Config) -> dict:
296296
"""Serialize config object to a dictionary that can be pickled"""
297297
# Manual serialization to handle nested objects properly
298+
299+
# The asdict() call itself triggers the deepcopy which tries to serialize novelty_llm. Remove it first.
300+
config.database.novelty_llm = None
301+
298302
return {
299303
"llm": {
300304
"models": [asdict(m) for m in config.llm.models],

0 commit comments

Comments
 (0)