File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ class DatabaseConfig:
8383 # Migration parameters for island-based evolution
8484 migration_interval : int = 50 # Migrate every N generations
8585 migration_rate : float = 0.1 # Fraction of population to migrate
86-
86+
8787 # Random seed for reproducible sampling
8888 random_seed : Optional [int ] = None
8989
Original file line number Diff line number Diff line change @@ -66,11 +66,12 @@ def __init__(
6666
6767 # Set up logging
6868 self ._setup_logging ()
69-
69+
7070 # Set random seed for reproducibility if specified
7171 if self .config .random_seed is not None :
7272 import random
7373 import numpy as np
74+
7475 random .seed (self .config .random_seed )
7576 np .random .seed (self .config .random_seed )
7677 logger .info (f"Set random seed to { self .config .random_seed } for reproducibility" )
@@ -93,11 +94,11 @@ def __init__(
9394 # Initialize components
9495 self .llm_ensemble = LLMEnsemble (self .config .llm )
9596 self .prompt_sampler = PromptSampler (self .config .prompt )
96-
97+
9798 # Pass random seed to database if specified
9899 if self .config .random_seed is not None :
99100 self .config .database .random_seed = self .config .random_seed
100-
101+
101102 self .database = ProgramDatabase (self .config .database )
102103 self .evaluator = Evaluator (self .config .evaluator , evaluation_file , self .llm_ensemble )
103104
Original file line number Diff line number Diff line change @@ -97,10 +97,11 @@ def __init__(self, config: DatabaseConfig):
9797 # Load database from disk if path is provided
9898 if config .db_path and os .path .exists (config .db_path ):
9999 self .load (config .db_path )
100-
100+
101101 # Set random seed for reproducible sampling if specified
102102 if config .random_seed is not None :
103103 import random
104+
104105 random .seed (config .random_seed )
105106 logger .debug (f"Database: Set random seed to { config .random_seed } " )
106107
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def __init__(
3737 async def generate (self , prompt : str , ** kwargs ) -> str :
3838 """Generate text from a prompt"""
3939 # Use default system message if not provided in kwargs
40- system_message = kwargs .pop (' system_message' , "You are a helpful assistant." )
40+ system_message = kwargs .pop (" system_message" , "You are a helpful assistant." )
4141 return await self .generate_with_context (
4242 system_message = system_message ,
4343 messages = [{"role" : "user" , "content" : prompt }],
You can’t perform that action at this time.
0 commit comments