Instructions to use weizhiwang/mlm-filter-llava-13b-gpt4v with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use weizhiwang/mlm-filter-llava-13b-gpt4v with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="weizhiwang/mlm-filter-llava-13b-gpt4v")# Load model directly from transformers import AutoProcessor, AutoModelForCausalLM processor = AutoProcessor.from_pretrained("weizhiwang/mlm-filter-llava-13b-gpt4v") model = AutoModelForCausalLM.from_pretrained("weizhiwang/mlm-filter-llava-13b-gpt4v", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use weizhiwang/mlm-filter-llava-13b-gpt4v with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "weizhiwang/mlm-filter-llava-13b-gpt4v" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "weizhiwang/mlm-filter-llava-13b-gpt4v", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/weizhiwang/mlm-filter-llava-13b-gpt4v
- SGLang
How to use weizhiwang/mlm-filter-llava-13b-gpt4v with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "weizhiwang/mlm-filter-llava-13b-gpt4v" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "weizhiwang/mlm-filter-llava-13b-gpt4v", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "weizhiwang/mlm-filter-llava-13b-gpt4v" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "weizhiwang/mlm-filter-llava-13b-gpt4v", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use weizhiwang/mlm-filter-llava-13b-gpt4v with Docker Model Runner:
docker model run hf.co/weizhiwang/mlm-filter-llava-13b-gpt4v
MLM-Filter-13b Model Card
Model details
Model type: MLM-Filter-13b is an open-source MLLM trained to assess the data quality of image-text paired data. It can generate 4 quality metrics for image-text data: Image Text Matching, Object Detail Fulfillment, Caption Text Quality, and Semantic Understanding.
Model date: MLM-Filter-13B was trained in Dec 2023.
Paper or resources for more information: https://mlm-filter.github.io/
@article{wang2024finetuned,
title={Finetuned Multimodal Language Models Are High-Quality Image-Text Data Filters},
author={Wang, Weizhi and Mrini, Khalil and Yang, Linjie and Kumar, Sateesh and Tian, Yu and Yan, Xifeng and Wang, Heng},
journal={arXiv preprint arXiv:2403.02677},
year={2024}
}
License
Llama 2 is licensed under the LLAMA 2 Community License, Copyright (c) Meta Platforms, Inc. All Rights Reserved.
Where to send questions or comments about the model: https://github.com/Victorwz/MLM_Filter/issues
Intended use
Primary intended uses: MLM-Filter can be used as a drop-in replacement for CLIPScore in these tasks:
Score image-text data in large-scale pre-training dataset and then filter high-quality subsets based on the scores (For training MLLMs or VLMs, please consider to jointly use the Image-Text Matching score and the Object Detail Fulfillment score);
Evaluate the image-text alignment for image2text or text2image generation models;
Any potential applications with the need to calculate the image-text alignment.
Training dataset
- 46k instruction sampled from LLaVA-1.5 665k data.
- 4k instructions on image-text data quality assessment tasks ranging across 4 metrics.
Usage Sample
Please follow the instructions in https://github.com/Victorwz/MLM_Filter.
- Downloads last month
- 22