MiniCPM5-1B-int4-ov
- Model creator: OpenBMB
- Original model: MiniCPM5-1B
EXPERIMENTAL MODEL This model has not been fully validated with OpenVINO and is using a custom branch of optimum-intel. It may be fully supported and validated in the future.
Description
This is MiniCPM5-1B model converted to the OpenVINO™ IR (Intermediate Representation) format.
Compatibility
The provided OpenVINO™ IR model is compatible with:
- OpenVINO version 2026.2.0 and higher
- Optimum Intel 1.27.0 and higher
Running Model Inference with Optimum Intel
- Install packages required for using Optimum Intel integration with the OpenVINO backend:
pip install optimum[openvino]
- Loading on CPU:
from pathlib import Path
from optimum.intel import OVModelForCausalLM
from transformers import AutoTokenizer
model_dir = Path("./minicpm5_ov")
model = OVModelForCausalLM.from_pretrained(model_dir, device="CPU")
tokenizer = AutoTokenizer.from_pretrained(model_dir)
print("Loaded model:", type(model).__name__)
print("Tokenizer:", type(tokenizer).__name__)
- CPU inference:
prompt = "Explain what OpenVINO is in one sentence."
inputs = tokenizer(prompt, return_tensors="pt")
output_ids = model.generate(**inputs, max_new_tokens=24)
print(tokenizer.decode(output_ids[0], skip_special_tokens=True))
- GPU inference:
import time
prompt = "Explain what OpenVINO is in one sentence."
inputs = tokenizer(prompt, return_tensors="pt")
for device in ("GPU.1", "GPU.0"):
start = time.perf_counter()
gpu_model = OVModelForCausalLM.from_pretrained(model_dir, device=device)
load_s = time.perf_counter() - start
start = time.perf_counter()
gpu_output_ids = gpu_model.generate(**inputs, max_new_tokens=24)
gen_s = time.perf_counter() - start
print(f"{device}: load={load_s:.2f}s, generate={gen_s:.2f}s")
print(tokenizer.decode(gpu_output_ids[0], skip_special_tokens=True))
print("-" * 80)
Limitations
Check the original model card for limitations.
Legal information
The original model is distributed under Apache License Version 2.0 license. More details can be found in MiniCPM5-1B.
Disclaimer
Intel is committed to respecting human rights and avoiding causing or contributing to adverse impacts on human rights. See Intel's Global Human Rights Principles. Intel's products and software are intended only to be used in applications that do not cause or contribute to adverse impacts on human rights.
- Downloads last month
- 19
Model tree for OpenVINO/MiniCPM5-1B-int4-ov
Base model
openbmb/MiniCPM5-1B