Text Generation
Transformers
PyTorch
Safetensors
English
idefics
image-text-to-text
multimodal
text
image
image-to-text
text-generation-inference
Instructions to use HuggingFaceM4/idefics-80b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceM4/idefics-80b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HuggingFaceM4/idefics-80b-instruct")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("HuggingFaceM4/idefics-80b-instruct") model = AutoModelForImageTextToText.from_pretrained("HuggingFaceM4/idefics-80b-instruct") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use HuggingFaceM4/idefics-80b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HuggingFaceM4/idefics-80b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceM4/idefics-80b-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/HuggingFaceM4/idefics-80b-instruct
- SGLang
How to use HuggingFaceM4/idefics-80b-instruct 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 "HuggingFaceM4/idefics-80b-instruct" \ --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": "HuggingFaceM4/idefics-80b-instruct", "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 "HuggingFaceM4/idefics-80b-instruct" \ --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": "HuggingFaceM4/idefics-80b-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use HuggingFaceM4/idefics-80b-instruct with Docker Model Runner:
docker model run hf.co/HuggingFaceM4/idefics-80b-instruct
Commit ·
0979cbf
1
Parent(s): aca8e0b
Update config.json
Browse files- config.json +6 -4
config.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
"alpha_type": "float",
|
| 6 |
"alphas_initializer_range": 0.0,
|
| 7 |
"architectures": [
|
| 8 |
-
"
|
| 9 |
],
|
| 10 |
"bos_token_id": 1,
|
| 11 |
"cross_layer_activation_function": "swiglu",
|
|
@@ -22,7 +22,7 @@
|
|
| 22 |
"initializer_range": 0.02,
|
| 23 |
"intermediate_size": 22016,
|
| 24 |
"max_sequence_length": 2048,
|
| 25 |
-
"model_type": "
|
| 26 |
"num_attention_heads": 64,
|
| 27 |
"num_hidden_layers": 80,
|
| 28 |
"pad_token_id": 0,
|
|
@@ -40,7 +40,9 @@
|
|
| 40 |
"use_resampler": true,
|
| 41 |
"vision_embed_dim": 1280,
|
| 42 |
"vision_image_size": 224,
|
| 43 |
-
"
|
| 44 |
-
"
|
|
|
|
|
|
|
| 45 |
"vocab_size": 32000
|
| 46 |
}
|
|
|
|
| 5 |
"alpha_type": "float",
|
| 6 |
"alphas_initializer_range": 0.0,
|
| 7 |
"architectures": [
|
| 8 |
+
"IdeficsForCausalLM"
|
| 9 |
],
|
| 10 |
"bos_token_id": 1,
|
| 11 |
"cross_layer_activation_function": "swiglu",
|
|
|
|
| 22 |
"initializer_range": 0.02,
|
| 23 |
"intermediate_size": 22016,
|
| 24 |
"max_sequence_length": 2048,
|
| 25 |
+
"model_type": "idefics",
|
| 26 |
"num_attention_heads": 64,
|
| 27 |
"num_hidden_layers": 80,
|
| 28 |
"pad_token_id": 0,
|
|
|
|
| 40 |
"use_resampler": true,
|
| 41 |
"vision_embed_dim": 1280,
|
| 42 |
"vision_image_size": 224,
|
| 43 |
+
"vision_intermediate_size": 5120,
|
| 44 |
+
"vision_patch_size": 14,
|
| 45 |
+
"vision_num_attention_heads": 16,
|
| 46 |
+
"vision_num_hidden_layers": 32,
|
| 47 |
"vocab_size": 32000
|
| 48 |
}
|