Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I use my own model in.bin format #916

Open
xzlinux opened this issue Jul 25, 2024 · 1 comment
Open

Can I use my own model in.bin format #916

xzlinux opened this issue Jul 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@xzlinux
Copy link

xzlinux commented Jul 25, 2024

Can I use my own model in.bin format,tks

@xzlinux xzlinux added the enhancement New feature or request label Jul 25, 2024
@wanliAlex
Copy link
Collaborator

Hi @xzlinux , thanks for using Marqo.

You didn't mention which model you are trying to load, so I will use two widely used model types, sentence-transformers and open_clip, as examples here. The short answer is YES.

OpenCLIP Models

To load a .bin model into open_clip, you can provide a URL to your .bin file and follow the instructions here. For example, if you want to load this model, you can set the index settings as follows:

settings = {
    "treatUrlsAndPointersAsImages": True,
    "model": "generic-clip-test-model-1",
    "modelProperties": {
        "name": "ViT-B-32",
        "dimensions": 512,
        "url": "https://huggingface.co/laion/CLIP-ViT-B-32-laion2B-s34B-b79K/resolve/main/open_clip_pytorch_model.bin",
        "type": "open_clip",
    },
    "normalizeEmbeddings": True,
}

Note that the URL is the download link to the file open_clip_pytorch_model.bin instead of pytorch_model.bin.

Sentence-Transformer Models

For sentence-transformer models, Marqo leverages the HF loader to load a custom model. I recommend uploading your .bin model to a Hugging Face repo by following the instructions here. You can then follow the instructions here to load your uploaded model.

I hope this helps! If you have any further questions, feel free to ask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants