Instructions to use Emma02/LVM_ckpts with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Emma02/LVM_ckpts with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Emma02/LVM_ckpts")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Emma02/LVM_ckpts") model = AutoModelForMultimodalLM.from_pretrained("Emma02/LVM_ckpts") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Emma02/LVM_ckpts with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Emma02/LVM_ckpts" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Emma02/LVM_ckpts", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Emma02/LVM_ckpts
- SGLang
How to use Emma02/LVM_ckpts 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 "Emma02/LVM_ckpts" \ --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": "Emma02/LVM_ckpts", "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 "Emma02/LVM_ckpts" \ --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": "Emma02/LVM_ckpts", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Emma02/LVM_ckpts with Docker Model Runner:
docker model run hf.co/Emma02/LVM_ckpts
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LVM
|
| 2 |
+
|
| 3 |
+
This is the model implementation of the CVPR 2024 'Sequential Modeling Enables Scalable Learning for Large Vision Models'. (https://arxiv.org/abs/2312.00785)
|
| 4 |
+
|
| 5 |
+
LVM is a vision pretraining model that converts various kinds of visual data into visual sentences and performs next-token prediction autoregressively. It is compatible with both GPU and TPU.
|
| 6 |
+
|
| 7 |
+
LVM is built on top of [OpenLLaMA](https://github.com/openlm-research/open_llama) (an autoregressive model) and [OpenMuse](https://github.com/huggingface/open-muse) (a VQGAN that converts images into visual tokens).
|
| 8 |
+
|
| 9 |
+
This was trained in collaboration with HuggingFace. Thanks [Victor Sanh](https://huggingface.co/VictorSanh) for the support in this project.
|
| 10 |
+
|
| 11 |
+
## Key Differences from the Original Paper Version
|
| 12 |
+
1. We are currently releasing the 7B model (previously 3B). Additional model size variants will be available soon.
|
| 13 |
+
2. Deep filtering (including quality filters, deduplication, and known CSAM content removal) has been applied to the LAION dataset, reducing the dataset size from 1.5B to 1.2B images.
|
| 14 |
+
|
| 15 |
+
3. The tokenizer has been improved for better performance.
|
| 16 |
+
|
| 17 |
+
## License
|
| 18 |
+
LVM is licensed under the Apache 2.0 License.
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
## Citation
|
| 22 |
+
If you found LVM useful in your research or applications, please cite our work using the following BibTeX:
|
| 23 |
+
\`\`\`bibtex
|
| 24 |
+
@article{bai2023sequential,
|
| 25 |
+
title={Sequential modeling enables scalable learning for large vision models},
|
| 26 |
+
author={Bai, Yutong and Geng, Xinyang and Mangalam, Karttikeya and Bar, Amir and Yuille, Alan and Darrell, Trevor and Malik, Jitendra and Efros, Alexei A},
|
| 27 |
+
journal={arXiv preprint arXiv:2312.00785},
|
| 28 |
+
year={2023}
|
| 29 |
+
}
|
| 30 |
+
\`\`\`
|