Skip to content

Import constants module instead of importing constant values directly #1172

@Wauplin

Description

@Wauplin

Best described by @albertvillanova in huggingface/datasets#5196 (comment) and huggingface/datasets#5196 (comment).

Basically, change from

from huggingface_hub.constants import CONSTANT_VALUE

CONSTANT_VALUE
(...)

to

from huggingface_hub import constants

constants.CONSTANT_VALUE
(...)

everywhere.

⚠️ This will most probable brake some monkey-patching in downstream libraries. Let's be careful about how to perform such a change. E.g. let's do it and make some tests before merging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions