Skip to content

More permissive config parsing and validation #45265

@vadimkantorov

Description

@vadimkantorov

Feature request

Make more permissive config.json/params.json parsing / validation: cast int constants as float without warnings

Motivation

E.g. when loading Leanstral (cf https://huggingface.co/mistralai/Leanstral-2603/discussions/7#69cfde05abe040f5323c6390):

Unrecognized keys in `rope_parameters` for 'rope_type'='yarn': {'apply_yarn_scaling'}
`rope_parameters`'s factor field must be a float >= 1, got 128
`rope_parameters`'s beta_fast field must be a float, got 32
`rope_parameters`'s beta_slow field must be a float, got 1
Unrecognized keys in `rope_parameters` for 'rope_type'='yarn': {'apply_yarn_scaling'}
`rope_parameters`'s factor field must be a float >= 1, got 128
`rope_parameters`'s beta_fast field must be a float, got 32
`rope_parameters`'s beta_slow field must be a float, got 1

1, 32, 128 should be auto-promoted to float

Your contribution

N/A

cc @juliendenize

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions