diff --git a/examples/rl_gsm8k/orchestrate_rl.py b/examples/rl_gsm8k/orchestrate_rl.py index be5d16b3..fdbcd8e7 100644 --- a/examples/rl_gsm8k/orchestrate_rl.py +++ b/examples/rl_gsm8k/orchestrate_rl.py @@ -357,6 +357,7 @@ def main(cfg: DictConfig): logger.info("Removing leading white space from the model. This is necessary for DeepSeek models") while state["iteration"] < cfg.max_iterations: + logger.info(f"Starting iteration {state['iteration']}") start_iteration = time.time() if os.path.exists(finetune_path / "current"): assistant_model_path = str(finetune_path / "current") diff --git a/tapeagents/llms.py b/tapeagents/llms.py index e7a1bc26..7745a45f 100644 --- a/tapeagents/llms.py +++ b/tapeagents/llms.py @@ -580,8 +580,10 @@ def _generate(self, prompt: Prompt) -> Generator[LLMEvent, None, None]: content = data["choices"][0]["message"]["content"] if self.remove_leading_white_space: # vllm sometimes adds a whitespace at the beginning of the completion - assert content[0] == " " - content = content[1:] + if content[0] == " ": + content = content[1:] + else: + logger.error(f"Expected leading white space in completion: \n{content}") if not content: logger.warning(f"Empty completion {data}")