Instructions to use impactframes/colpali-v1.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ColPali
How to use impactframes/colpali-v1.2 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
- Notebooks
- Google Colab
- Kaggle
Download training_config.yml from impactframes/colpali-v1.2: direct link, hf CLI and curl.
- Browser
- Download file 2.17 kB
-
https://huggingface.co/impactframes/colpali-v1.2/resolve/main/training_config.yml
- Command line
-
hf download hf://impactframes/colpali-v1.2/training_config.yml
-
curl -L -o training_config.yml https://huggingface.co/impactframes/colpali-v1.2/resolve/main/training_config.yml
2.17 kB
| config: | |
| (): colpali_engine.utils.train_colpali_engine_models.ColModelTrainingConfig | |
| output_dir: !path ../../../models/right_pad/train_colpali_hardneg_long | |
| processor: | |
| () : colpali_engine.utils.wrapper.AutoProcessorWrapper | |
| pretrained_model_name_or_path: "./models/colpaligemma-3b-pt-448-base" # "./models/paligemma-3b-mix-448" | |
| max_length: 50 | |
| model: | |
| (): colpali_engine.utils.wrapper.AllPurposeWrapper | |
| class_to_instanciate: !ext colpali_engine.models.paligemma_colbert_architecture.ColPali | |
| pretrained_model_name_or_path: "./models/colpaligemma-3b-pt-448-base" | |
| torch_dtype: !ext torch.bfloat16 | |
| # 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_ir_negs | |
| eval_dataset_loader: !import ../data/test_data.yaml | |
| max_length: 50 | |
| run_eval: true | |
| add_suffix: true | |
| loss_func: | |
| (): colpali_engine.loss.colbert_loss.ColbertPairwiseNegativeCELoss | |
| in_batch_term: true | |
| tr_args: | |
| (): transformers.training_args.TrainingArguments | |
| output_dir: null | |
| overwrite_output_dir: true | |
| num_train_epochs: 5 | |
| per_device_train_batch_size: 4 | |
| # 6 x 8 gpus = 48 batch size | |
| # gradient_accumulation_steps: 4 | |
| per_device_eval_batch_size: 4 | |
| eval_strategy: "steps" | |
| # dataloader_num_workers: 8 | |
| # bf16: true | |
| save_steps: 500 | |
| logging_steps: 10 | |
| eval_steps: 50 | |
| warmup_steps: 1000 | |
| learning_rate: 5e-5 | |
| save_total_limit: 1 | |
| resume_from_checkpoint: true | |
| # optim: "paged_adamw_8bit" | |
| 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: '(.*(language_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).*$)' | |