⚠️ Do not use with onnxruntime-genai; model architecture has a non-standard head size of 120 which is not divisible by 16.
from google.colab import drive
drive.mount('/content/drive')
!pip install "optimum[onnxruntime-gpu]" transformers
!pip install numpy onnxruntime-genai
from huggingface_hub import snapshot_download
import os
# --- STEP 1: Download the model locally ---
print("Downloading model snapshot to local disk...")
# We use Python here so we don't need the flag in the command line later
local_model_path = snapshot_download(
repo_id="h2oai/h2o-danube3.1-4b-chat",
ignore_patterns=["*.msgpack", "*.h5", "*.ot"] # Skip useless files to save speed
)
print(f"Model downloaded to: {local_model_path}")
# --- STEP 2: Run the Builder on the local files ---
# We pass the local path variable to the command using '$'
print("Starting INT4 Conversion...")
!python -m onnxruntime_genai.models.builder \
-m "$local_model_path" \
-o "/content/drive/My Drive/Danube_3_1_INT4_CPU" \
-p int4 \
-e cpu
print("REAL SUCCESS! Check your Drive folder: Danube_INT4_CPU")
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Model tree for keisuke-miyako/h2o-danube3.1-4b-chat-onnx-int4-NG
Base model
h2oai/h2o-danube3.1-4b-chat