Instructions to use AIPrep/gem-early-ckpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AIPrep/gem-early-ckpt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AIPrep/gem-early-ckpt")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("AIPrep/gem-early-ckpt") model = AutoModelForImageTextToText.from_pretrained("AIPrep/gem-early-ckpt") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use AIPrep/gem-early-ckpt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AIPrep/gem-early-ckpt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AIPrep/gem-early-ckpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AIPrep/gem-early-ckpt
- SGLang
How to use AIPrep/gem-early-ckpt 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 "AIPrep/gem-early-ckpt" \ --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": "AIPrep/gem-early-ckpt", "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 "AIPrep/gem-early-ckpt" \ --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": "AIPrep/gem-early-ckpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AIPrep/gem-early-ckpt with Docker Model Runner:
docker model run hf.co/AIPrep/gem-early-ckpt
| { | |
| "dim": 5120, | |
| "n_layers": 40, | |
| "head_dim": 128, | |
| "hidden_dim": 32768, | |
| "n_heads": 32, | |
| "n_kv_heads": 8, | |
| "rope_theta": 1000000000.0, | |
| "norm_eps": 1e-05, | |
| "vocab_size": 131072, | |
| "max_position_embeddings": 131072, | |
| "vision_encoder": { | |
| "hidden_size": 1024, | |
| "num_channels": 3, | |
| "max_image_size": 1540, | |
| "patch_size": 14, | |
| "rope_theta": 10000.0, | |
| "intermediate_size": 4096, | |
| "num_hidden_layers": 24, | |
| "num_attention_heads": 16, | |
| "adapter_bias": false, | |
| "mm_projector_id": "patch_merge", | |
| "spatial_merge_size": 2, | |
| "add_pre_mm_projector_layer_norm": true, | |
| "image_token_id": 10, | |
| "image_break_token_id": 12, | |
| "image_end_token_id": 13, | |
| "image_size": 1540 | |
| } | |
| } |