Skip to content

Fix: Beam search inference bug and weight loading prefix issue #4

@lxygoodjob

Description

@lxygoodjob

Hi team,
First of all, thank you for open-sourcing this excellent project. During my testing, I identified a few code issues, primarily in the inference module:
Weight loading prefix issue: When loading pretrained model weights (possibly version-specific to my torch installation), there was an issue with the _orig_mod. prefix in state dict keys. I've provided a workaround example in MS2SMILES_yaml_predictor.py (lines 162-172).
Bug in beam_search_inference: The beam search implementation had a bug that has been fixed in MS2SMILES_Model.py. This fix also addresses the empty prediction issue reported in issue #3.
Thanks again for your work!

MS2SMILES_Model.py

MS2SMILES_yaml_predictor.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions