Skip to content

bpe_simple_vocab_16e6.txt.gz missing #339

@lexhacke

Description

@lexhacke

Getting FileNotFound error when trying to load processor. For this file in particular "bpe_simple_vocab_16e6.txt.gz"

This is my patch :P

try:
self.model = build_sam3_image_model()
self.processor = Sam3Processor(self.model)
except FileNotFoundError:
response = requests.get("https://github.com/openai/CLIP/raw/refs/heads/main/clip/bpe_simple_vocab_16e6.txt.gz", stream=True) # Use stream=True for large files
response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)

        # 3. Write the content to the local file
        with open('/usr/local/lib/python3.12/dist-packages/assets/bpe_simple_vocab_16e6.txt.gz', 'wb') as f:
            for chunk in response.iter_content(chunk_size=8192):
                f.write(chunk)

        self.model = build_sam3_image_model()
        self.processor = Sam3Processor(self.model)
    finally:
        print('Dude it wasnt the bpe tokenizer :(')

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