Instructions to use nassimjp/MiniCPM-V-4.7-1B-Pashto-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nassimjp/MiniCPM-V-4.7-1B-Pashto-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="nassimjp/MiniCPM-V-4.7-1B-Pashto-Base") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("nassimjp/MiniCPM-V-4.7-1B-Pashto-Base") model = AutoModelForMultimodalLM.from_pretrained("nassimjp/MiniCPM-V-4.7-1B-Pashto-Base", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nassimjp/MiniCPM-V-4.7-1B-Pashto-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nassimjp/MiniCPM-V-4.7-1B-Pashto-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nassimjp/MiniCPM-V-4.7-1B-Pashto-Base", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/nassimjp/MiniCPM-V-4.7-1B-Pashto-Base
- SGLang
How to use nassimjp/MiniCPM-V-4.7-1B-Pashto-Base 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 "nassimjp/MiniCPM-V-4.7-1B-Pashto-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nassimjp/MiniCPM-V-4.7-1B-Pashto-Base", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "nassimjp/MiniCPM-V-4.7-1B-Pashto-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nassimjp/MiniCPM-V-4.7-1B-Pashto-Base", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Unsloth Desktop
- Docker Model Runner
How to use nassimjp/MiniCPM-V-4.7-1B-Pashto-Base with Docker Model Runner:
docker model run hf.co/nassimjp/MiniCPM-V-4.7-1B-Pashto-Base
MiniCPM-V-4.7-1B-Pashto-Base
This is the Stage 2 base checkpoint of the nassimjp/MiniCPM-V-4.7-1B-Pashto model, fine-tuned from openbmb/MiniCPM-V-4.7-1B.
In this stage, the 18 newly added Pashto-specific atomic tokens and their embedding/lm_head weights (which were initialized randomly in Stage 1) have been aligned and harmonized with the surrounding Arabic-script embedding space, preparing the model for downstream multimodal and text fine-tuning.
- Developed by: nassimjp
- License: apache-2.0
- Finetuned from model:
nassimjp/MiniCPM-V-4.7-1B-Pashto - Base Model:
openbmb/MiniCPM-V-4.7-1B - Architecture: MiniCPMV4_7ForConditionalGeneration
Training & Alignment Details
- Stage: Stage 2 Alignment (Embedding & Initial Adaptation)
- Framework: Unsloth / Hugging Face TRL
- Precision: 16-bit (FP16 / BF16)
This minicpmv4_7 model was trained 2x faster with Unsloth and Huggingface's TRL library.

About MiniCPM-V 4.7 (Base Architecture Overview)
MiniCPM-V 4.7 is the latest model in the MiniCPM-V series, available in a 1B variant. It builds on the family's single-image, multi-image, and video understanding capabilities, combining stronger foundation capabilities with efficient visual encoding and on-device inference. Notable features of MiniCPM-V 4.7 include:
- 🔥 A New Pareto Frontier in Performance and Efficiency. As model capabilities continue to advance, inference efficiency has become an important measure of a model's value. The 1B variant of MiniCPM-V 4.7 advances the performance–efficiency Pareto frontier for MLLMs.
- 🚀 Efficient Architecture. Based on the intra-ViT early compression technique from LLaVA-UHD v4, MiniCPM-V 4.7 compresses visual tokens early within the vision encoder.
- 💻 Broad Platform and Chip Support. MiniCPM-V 4.7 supports iOS, Android, and HarmonyOS, together with open-source on-device deployment support.
Usage Example (Pashto-Base)
import torch
from transformers import AutoProcessor, AutoModelForImageTextToText
model_id = "nassimjp/MiniCPM-V-4.7-1B-Pashto-Base"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
model.eval()
messages = [
{
"role": "user",
"content": "ته د خپل وزن خبره کوه😜 چې څومره نغدی چغدی جوړوي",
},
]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt",
).to(model.device)
with torch.no_grad():
output = model.generate(**inputs, max_new_tokens=128)
generated = output[0][inputs["input_ids"].shape[1]:]
print(processor.tokenizer.decode(generated, skip_special_tokens=True))
Intended Use
- Foundation Checkpoint: Ready for full-scale Supervised Fine-Tuning (SFT) or LoRA on Pashto text and multimodal datasets.
- Multimodal Pashto Tasks: Capable of handling image-text-to-text tasks with native Pashto script alignment.
- Downloads last month
- 73