MiniCPM5-15B-A2.5B-fp16-ov
- Model creator: OpenBMB
- Original model: MiniCPM5-15B-A2.5B
EXPERIMENTAL MODEL This model has not been fully validated with OpenVINO and uses development versions of Optimum Intel and OpenVINO GenAI.
Description
This is MiniCPM5-15B-A2.5B model converted to the OpenVINO™ IR (Intermediate Representation) format.
Compatibility
The provided OpenVINO™ IR model is compatible with:
- OpenVINO nightly build 2027.0.0.dev20261202 and higher
- Optimum Intel from the
mainbranch
Running Model Inference with Optimum Intel
- Install packages required for using Optimum Intel integration with the OpenVINO backend:
pip install --pre "openvino>=2027.0.0.dev20261202" "openvino-tokenizers>=2027.0.0.0.dev20261202" --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly --extra-index-url https://download.pytorch.org/whl/cpu
pip install "optimum-intel[openvino]@git+https://github.com/huggingface/optimum-intel.git" --extra-index-url https://download.pytorch.org/whl/cpu
pip install "transformers==5.25.1" --extra-index-url https://download.pytorch.org/whl/cpu
- Run model inference:
from transformers import AutoTokenizer
from optimum.intel.openvino import OVModelForCausalLM
model_id = "OpenVINO/MiniCPM5-15B-A2.5B-fp16-ov"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = OVModelForCausalLM.from_pretrained(model_id)
messages = [{"role": "user", "content": "What is OpenVINO?"}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_dict=True, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=1024)
print(tokenizer.decode(outputs[0, inputs["input_ids"].shape[1] :], skip_special_tokens=True))
For more examples and possible optimizations, refer to the Inference with Optimum Intel.
Running Model Inference with OpenVINO GenAI
- Install packages required for using OpenVINO GenAI.
pip install huggingface_hub
pip install --pre "openvino>=2027.0.0.dev20261202" "openvino-genai>=2027.0.0.0.dev20261202" "openvino-tokenizers>=2027.0.0.0.dev20261202" --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
- Download model from HuggingFace Hub
import huggingface_hub as hf_hub
model_id = "OpenVINO/MiniCPM5-15B-A2.5B-fp16-ov"
model_path = "MiniCPM5-15B-A2.5B-fp16-ov"
hf_hub.snapshot_download(model_id, local_dir=model_path)
- Run model inference:
import openvino_genai as ov_genai
device = "CPU" # or "GPU"
# On GPU, use an i8 KV cache: the default u4 can make tool calls unreliable. CPU does not support i8.
config = {"KV_CACHE_PRECISION": "i8", "KEY_CACHE_QUANT_MODE": "BY_TOKEN"} if device == "GPU" else {}
pipe = ov_genai.LLMPipeline(model_path, device, **config)
history = ov_genai.ChatHistory([{"role": "user", "content": "What is OpenVINO?"}])
print(pipe.generate(history, max_new_tokens=2048))
More GenAI usage examples can be found in OpenVINO GenAI library docs and samples.
You can find more detailed usage examples in OpenVINO Notebooks:
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-15B-A2.5B.
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
- 150
Model tree for OpenVINO/MiniCPM5-15B-A2.5B-fp16-ov
Base model
openbmb/MiniCPM5-15B-A2.5B