Visual Document Retrieval
ColPali
Safetensors
sentence-transformers
English
colsmolvlm
vidore-experimental
vidore
multi-vector
Instructions to use vidore/colSmol-500M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ColPali
How to use vidore/colSmol-500M with ColPali:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- sentence-transformers
How to use vidore/colSmol-500M with sentence-transformers:
from sentence_transformers import MultiVectorEncoder model = MultiVectorEncoder("vidore/colSmol-500M") queries = ["Which planet is known as the Red Planet?"] documents = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", ] query_embeddings = model.encode_query(queries) document_embeddings = model.encode_document(documents) similarities = model.similarity(query_embeddings, document_embeddings) print(similarities) - Notebooks
- Google Colab
- Kaggle
Download training_config.yml from vidore/colSmol-500M: direct link, hf CLI and curl.
- Browser
- Download file 2.48 kB
-
https://huggingface.co/vidore/colSmol-500M/resolve/main/training_config.yml
- Command line
-
hf download hf://vidore/colSmol-500M/training_config.yml
-
curl -L -o training_config.yml https://huggingface.co/vidore/colSmol-500M/resolve/main/training_config.yml
2.48 kB
| config: | |
| (): colpali_engine.trainer.colmodel_training.ColModelTrainingConfig | |
| output_dir: !path ../../../models/ColSmolVLM-Instruct-500M | |
| processor: | |
| (): colpali_engine.utils.transformers_wrappers.AllPurposeWrapper | |
| class_to_instanciate: !ext colpali_engine.models.ColIdefics3Processor | |
| pretrained_model_name_or_path: "./models/ColSmolVLM-Instruct-500M" | |
| # num_image_tokens: 2048 | |
| # max_length: 50 | |
| model: | |
| (): colpali_engine.utils.transformers_wrappers.AllPurposeWrapper | |
| class_to_instanciate: !ext colpali_engine.models.ColIdefics3 | |
| pretrained_model_name_or_path: "./models/ColSmolVLM-Instruct-500M" | |
| torch_dtype: !ext torch.bfloat16 | |
| # use_cache: false | |
| attn_implementation: "flash_attention_2" | |
| # device_map: "auto" | |
| # quantization_config: | |
| # (): transformers.BitsAndBytesConfig | |
| # load_in_4bit: true | |
| # bnb_4bit_quant_type: "nf4" | |
| # bnb_4bit_compute_dtype: "bfloat16" | |
| # bnb_4bit_use_double_quant: true | |
| dataset_loading_func: !ext colpali_engine.utils.dataset_transformation.load_train_set | |
| eval_dataset_loader: !import ../data/test_data.yaml | |
| # max_length: 50 | |
| run_eval: true | |
| loss_func: | |
| (): colpali_engine.loss.late_interaction_losses.ColbertPairwiseCELoss | |
| tr_args: | |
| (): transformers.training_args.TrainingArguments | |
| output_dir: null | |
| overwrite_output_dir: true | |
| num_train_epochs: 3 | |
| per_device_train_batch_size: 8 | |
| gradient_checkpointing: true | |
| gradient_checkpointing_kwargs: { "use_reentrant": false } | |
| # gradient_checkpointing: true | |
| # 6 x 8 gpus = 48 batch size | |
| # gradient_accumulation_steps: 4 | |
| per_device_eval_batch_size: 4 | |
| eval_strategy: "steps" | |
| dataloader_num_workers: 6 | |
| # bf16: true | |
| save_steps: 500 | |
| logging_steps: 10 | |
| eval_steps: 100 | |
| warmup_steps: 100 | |
| learning_rate: 5e-4 | |
| save_total_limit: 1 | |
| resume_from_checkpoint: true | |
| # optim: "paged_adamw_8bit" | |
| # wandb logging | |
| # wandb_project: "colqwen2" | |
| # run_name: "colqwen2-ba32-nolora" | |
| report_to: "wandb" | |
| peft_config: | |
| (): peft.LoraConfig | |
| r: 32 | |
| lora_alpha: 32 | |
| lora_dropout: 0.1 | |
| init_lora_weights: "gaussian" | |
| bias: "none" | |
| task_type: "FEATURE_EXTRACTION" | |
| target_modules: '(.*(model.text_model).*(down_proj|gate_proj|up_proj|k_proj|q_proj|v_proj|o_proj).*$|.*(custom_text_proj).*$)' | |
| # target_modules: '(.*(language_model).*(down_proj|gate_proj|up_proj|k_proj|q_proj|v_proj|o_proj).*$|.*(custom_text_proj).*$)' | |