Image-Text-to-Text
Transformers
Safetensors
modilify_mk1
text-generation
diffusion
multimodal
mixture-of-experts
trust-remote-code
conversational
custom_code
Instructions to use modilify/Modilify-Mk1-preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use modilify/Modilify-Mk1-preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="modilify/Modilify-Mk1-preview", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("modilify/Modilify-Mk1-preview", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use modilify/Modilify-Mk1-preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "modilify/Modilify-Mk1-preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modilify/Modilify-Mk1-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/modilify/Modilify-Mk1-preview
- SGLang
How to use modilify/Modilify-Mk1-preview 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 "modilify/Modilify-Mk1-preview" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modilify/Modilify-Mk1-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "modilify/Modilify-Mk1-preview" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modilify/Modilify-Mk1-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use modilify/Modilify-Mk1-preview with Docker Model Runner:
docker model run hf.co/modilify/Modilify-Mk1-preview
Publish Modilify Mk1 Preview
Browse files
README.md
CHANGED
|
@@ -124,8 +124,7 @@ output = model.generate(**inputs, max_new_tokens=256)
|
|
| 124 |
|
| 125 |
### Video-frame input
|
| 126 |
|
| 127 |
-
The processor represents video as a sampled sequence of frames. The following
|
| 128 |
-
example uses PyAV to decode a short local clip and samples at most 32 RGB frames.
|
| 129 |
|
| 130 |
```python
|
| 131 |
import av
|
|
@@ -198,10 +197,7 @@ model = AutoModelForMultimodalLM.from_pretrained(
|
|
| 198 |
)
|
| 199 |
```
|
| 200 |
|
| 201 |
-
Generation supports left-padded batches with independent stopping and
|
| 202 |
-
`generated_lengths` for every row. Batch prompts of similar lengths together
|
| 203 |
-
for the best throughput; KV-cache and canvas memory grow with batch size.
|
| 204 |
-
Streaming and caller-supplied KV caches remain limited to batch size 1.
|
| 205 |
|
| 206 |
## Details
|
| 207 |
|
|
|
|
| 124 |
|
| 125 |
### Video-frame input
|
| 126 |
|
| 127 |
+
The processor represents video as a sampled sequence of frames. The following example uses PyAV to decode a short local clip and samples at most 32 RGB frames.
|
|
|
|
| 128 |
|
| 129 |
```python
|
| 130 |
import av
|
|
|
|
| 197 |
)
|
| 198 |
```
|
| 199 |
|
| 200 |
+
Generation supports left-padded batches with independent stopping and `generated_lengths` for every row. Batch prompts of similar lengths together for the best throughput; KV-cache and canvas memory grow with batch size. Streaming and caller-supplied KV caches remain limited to batch size 1.
|
|
|
|
|
|
|
|
|
|
| 201 |
|
| 202 |
## Details
|
| 203 |
|