sam3 icon indicating copy to clipboard operation
sam3 copied to clipboard

bpe_simple_vocab_16e6.txt.gz missing

Open lexhacke opened this issue 1 week ago • 4 comments

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 :(')

lexhacke avatar Dec 12 '25 06:12 lexhacke

i had the same issue today after their update yesterday so if you wanna run the model just do this. from sam3.model_builder import build_sam3_image_model from sam3.model.sam3_image_processor import Sam3Processor

model = build_sam3_image_model("sam3/sam3/assets/bpe_simple_vocab_16e6.txt.gz") processor = Sam3Processor(model, confidence_threshold=0.3)

houssineidoudi12 avatar Dec 12 '25 09:12 houssineidoudi12

I have requested a pull for this issue #359

cheezafizz avatar Dec 17 '25 08:12 cheezafizz

Still facing same issue, the solution from @houssineidoudi12 works for now.

anilstream avatar Dec 18 '25 11:12 anilstream