Skip to content

Conversation

@ehsk
Copy link
Collaborator

@ehsk ehsk commented Nov 10, 2025

Addresses #92

This tiny PR (only preprocess.py):

  • Throws exception when batch is empty and sample sequence length does not match the config.
  • More information added for debugging when an error is raised in populate_rl_data.

logger.error(f"RL config: {rl_config}")
logger.error(f"LLM: {llm}")
logger.error(f"Seq length: {seq_length}")
raise e
Copy link
Collaborator

@rafapi rafapi Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these logger calls are heavier than they look, you could keep this lighter and simpler with something like:

    except Exception:
        logger.exception(
            "Error in populate_rl_data",
            extra={
                "Seq length": seq_length,
                "eos_token_id": int(eos_id),
                ...
            },
        )
        raise  <-- this (no e) already keeps the stack trace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants