Image-Text-to-Text
Transformers
vision
vision-language-model
contrastive learning
self-supervised learning
Instructions to use sankim2/cosmos with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sankim2/cosmos with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="sankim2/cosmos")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sankim2/cosmos", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sankim2/cosmos with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sankim2/cosmos" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sankim2/cosmos", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sankim2/cosmos
- SGLang
How to use sankim2/cosmos 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 "sankim2/cosmos" \ --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": "sankim2/cosmos", "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 "sankim2/cosmos" \ --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": "sankim2/cosmos", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sankim2/cosmos with Docker Model Runner:
docker model run hf.co/sankim2/cosmos
Update README.md
Browse files
README.md
CHANGED
|
@@ -15,4 +15,17 @@ COSMOS is introduced in the paper [COSMOS: Cross-Modality Self-Distillation for
|
|
| 15 |
|
| 16 |
**Usage**
|
| 17 |
|
| 18 |
-
Please refer to our [Github repo](https://github.com/ExplainableML/cosmos) for detailed usage.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
**Usage**
|
| 17 |
|
| 18 |
+
Please refer to our [Github repo](https://github.com/ExplainableML/cosmos) for detailed usage.
|
| 19 |
+
|
| 20 |
+
**Citation**
|
| 21 |
+
|
| 22 |
+
If you find our work useful, please consider citing:
|
| 23 |
+
|
| 24 |
+
```bibtex
|
| 25 |
+
@article{kim2024cosmos,
|
| 26 |
+
title={COSMOS: Cross-Modality Self-Distillation for Vision Language Pre-training},
|
| 27 |
+
author={Kim, Sanghwan and Xiao, Rui and Georgescu, Mariana-Iuliana and Alaniz, Stephan and Akata, Zeynep},
|
| 28 |
+
journal={arXiv preprint arXiv:2412.01814},
|
| 29 |
+
year={2024}
|
| 30 |
+
}
|
| 31 |
+
```
|