Skip to content

Fix FileNotFoundError / OSError in inference.py and documentation typo #35

@motalib-code

Description

@motalib-code

When running inference.py, the script fails with an OSError (specifically ValueError: Can't find 'adapter_config.json') because it attempts to load the LoRA adapter from a non-existent subdirectory named ./openmath-lora. The adapter files (adapter_model.safetensors and adapter_config.json) are located in the root directory of the repository.

Additionally, the README.md file incorrectly lists the inference script as inference.md in the directory structure section, whereas the actual file is named inference.py.

Approach:

Corrected Adapter Path: In inference.py, I updated the ADAPTER_PATH variable from "./openmath-lora" to "." (current directory). This ensures the peft library can find the adapter files located in the root.
Updated Code Comments: I updated the comments in inference.py that describe the expected folder structure to match the actual flat structure of the repository.
Fixed Documentation: I edited README.md to change the reference inference.md to inference.py in the "Repository Structure" section.
These changes ensure the inference script runs correctly out-of-the-box and the documentation accurately reflects the file names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions