Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Separate object construction from file reading #1624

@erip

Description

@erip

🚀 Feature

Tracking issue for this discussion. File-reading should probably be handled in a classmethod so files don't need to be written to construct certain objects.

One example would be the CLIPTokenizer, which currently accepts files. Ideally a user can provide their own merges, but to maintain the convenience of reading from a file, we could use from_pretrained or similar:

tokenizer = CLIPTokenizer.from_pretrained(encoder_json_path, vocab_bpe_path)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions