File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ def _setup_logging(self) -> None:
221221
222222 def _load_initial_program (self ) -> str :
223223 """Load the initial program from file"""
224- with open (self .initial_program_path , "r" ) as f :
224+ with open (self .initial_program_path , "r" , encoding = 'utf-8' ) as f :
225225 return f .read ()
226226
227227 async def run (
@@ -291,7 +291,7 @@ async def run(
291291 if numeric_metrics :
292292 avg_score = sum (numeric_metrics ) / len (numeric_metrics )
293293 logger .warning (
294- f"⚠️ No 'combined_score' metric found in evaluation results. "
294+ f"No 'combined_score' metric found in evaluation results. "
295295 f"Using average of all numeric metrics ({ avg_score :.4f} ) for evolution guidance. "
296296 f"For better evolution results, please modify your evaluator to return a 'combined_score' "
297297 f"metric that properly weights different aspects of program performance."
Original file line number Diff line number Diff line change @@ -133,6 +133,15 @@ async def generate_with_context(
133133 if reasoning_effort is not None :
134134 params ["reasoning_effort" ] = reasoning_effort
135135
136+ # ModelScope Qwen models require enable_thinking=false for non-streaming requests
137+ if (
138+ isinstance (self .api_base , str )
139+ and "api-inference.modelscope.cn" in self .api_base
140+ ):
141+ extra_body = kwargs .get ("extra_body" ) or {}
142+ extra_body .setdefault ("enable_thinking" , False )
143+ params ["extra_body" ] = extra_body
144+
136145 # Add seed parameter for reproducibility if configured
137146 # Skip seed parameter for Google AI Studio endpoint as it doesn't support it
138147 seed = kwargs .get ("seed" , self .random_seed )
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ def _load_from_directory(self, directory: Path) -> None:
202202 # Load fragments.json if exists
203203 fragments_file = directory / "fragments.json"
204204 if fragments_file .exists ():
205- with open (fragments_file , "r" ) as f :
205+ with open (fragments_file , "r" , encoding = 'utf-8' ) as f :
206206 loaded_fragments = json .load (f )
207207 self .fragments .update (loaded_fragments )
208208
You can’t perform that action at this time.
0 commit comments