A compact, unified multimodal model family with a single shared vision–language backbone, built for on-device and in-app intelligence.
Document WePM model downloads and inference quick start
KivingY009fc1ddb773
diff --git a/README.md b/README.mdindex bd50398..1d42122 100644--- a/README.md+++ b/README.md@@ -12,7 +12,7 @@On-device AI applications rarely depend on a single capability. A personal assistant may need multimodal retrieval to find local content, generation to understand and respond, and decision making to route the next action. Deploying a separate specialist for each path duplicates vision encoders and language backbones, increasing resident memory, system complexity and the cost of keeping intelligence always available on device.-**WePM** is a unified multimodal model family with planned **2B and 4B** releases, designed around a different principle: one compact vision–language backbone should support multiple capability families without sacrificing their individual quality. A single set of parameters provides:+**WePM** is a unified multimodal model family with **2B and 4B** variants, designed around a different principle: one compact vision–language backbone should support multiple capability families without sacrificing their individual quality. A single set of parameters provides:- **Representation** — L2-normalized multimodal embeddings for image retrieval, text retrieval and candidate ranking.- **Generation** — OCR, image captioning, visual question answering, summarization and assistant responses.@@ -94,129 +94,68 @@ https://github.com/user-attachments/assets/4384a5c4-30a7-42da-8fe3-750285c1fa3e## Inference-Runtime code and runnable cases are maintained in GitLab; the 2B and 4B model releases will be hosted separately on Hugging Face:+This repository provides the inference runtime and runnable examples for text generation from text and images, multimodal embeddings, and structured decisions.-| Model size | Hugging Face / safetensors |-| --- | --- |-| 4B | [WePocketModel1.0-4B](https://huggingface.co/tencent/WePocketModel1.0-4B) |-| 2B | [WePocketModel1.0-2B](https://huggingface.co/tencent/WePocketModel1.0-2B) |+### Model weights-These are the planned release addresses; downloads require the corresponding repositories to be published.+| Model size | Transformers (safetensors) | GGUF (CPU) |+| --- | --- | --- |+| 2B | [WePocketModel1.0-2B](https://huggingface.co/tencent/WePocketModel1.0-2B) | [WePocketModel1.0-2B-GGUF](https://huggingface.co/tencent/WePocketModel1.0-2B-GGUF) |+| 4B | [WePocketModel1.0-4B](https://huggingface.co/tencent/WePocketModel1.0-4B) | [WePocketModel1.0-4B-GGUF](https://huggingface.co/tencent/WePocketModel1.0-4B-GGUF) |-```text-inference/ # Transformers inference and optional CPU GGUF backend-examples/gpu/ # NVIDIA GPU task cases and input assets-examples/cpu/ # CPU task cases and input assets-checkpoints/ # Optional local downloads; model files are not tracked-```--The runnable examples default to a complete Hugging Face export and support generation, embedding extraction, and structured decision. Generation cases cover single-text, single-image, and ordered text–image interleaving. The hardware figures below apply to WePM-4B. The inference CLI also loads compatible 2B or 4B raw training exports and supports [GGUF inference on CPU](inference/README.md#gguf-on-cpu).--### Hardware and precision (4B)--| Device | Compute | Approximate weight memory | Recommended memory |-| --- | --- | --- | --- |-| NVIDIA GPU | BF16 | ≈8 GB | ≥16 GB GPU memory |-| CPU | FP32 | ≈17 GiB | ≥24 GiB system memory |+Run with a Hugging Face model ID from the table or a local checkpoint directory. Set `WEPM_MODEL` in the examples or pass `--model` to the CLI. By default, the examples use `tencent/WePocketModel1.0-4B`.-### Clone the code+### Quick start-Clone the inference code and examples:+Clone the repository and create a Python 3.10–3.13 environment.```bashgit clone https://github.com/Tencent/WePocketModelcd WePocketModel-```--The current branch does not bundle model weights or require Git LFS. Use a complete export from Hugging Face or point inference to an existing local checkpoint directory.--### Installation--Create a Python 3.10–3.13 environment:--```bashpython -m venv .venvsource .venv/bin/activate```-NVIDIA GPU (CUDA 12.8 example):+Install the PyTorch build for your device. On NVIDIA GPUs, use the CUDA wheel index compatible with your setup. This example uses CUDA 12.8.```bashpython -m pip install torch==2.10.0 torchvision==0.25.0 \--index-url https://download.pytorch.org/whl/cu128python -m pip install -r inference/requirements.txt++bash examples/gpu/generation/run.sh single_text```-CPU:+For Transformers on CPU, use the CPU wheel index.```bashpython -m pip install torch==2.10.0 torchvision==0.25.0 \--index-url https://download.pytorch.org/whl/cpupython -m pip install -r inference/requirements.txt-```--### Model selection and download--The scripts default to `tencent/WePocketModel1.0-4B`. The first online run downloads the complete export into the Hugging Face cache; subsequent runs reuse the cached files. Switch to the 2B release once published:--```bash-export WEPM_MODEL=tencent/WePocketModel1.0-2B-```--To download ahead of time and keep weights in a local directory:--```bash-hf download tencent/WePocketModel1.0-4B --local-dir checkpoints/WePocketModel1.0-4B-export WEPM_MODEL="$PWD/checkpoints/WePocketModel1.0-4B"-```--A local model directory is loaded without network access. For a cached repository ID, set `HF_HUB_OFFLINE=1` to prohibit network access. The [inference CLI](inference/README.md) also provides `--revision`, `--cache-dir`, and `--local-files-only`. Download the complete export for its auxiliary weights, tokenizer, processor and metadata. Inference uses the Python runtime shipped with this repository by default. Use `--trust-model-code` only for a model whose custom runtime code you have reviewed.-### NVIDIA GPU inference--#### Generation: single text, single image, or interleaved content--```bash-bash examples/gpu/generation/run.sh single_text-bash examples/gpu/generation/run.sh single_image-bash examples/gpu/generation/run.sh interleaved-```--#### Embedding extraction--```bash-bash examples/gpu/embedding/run.sh+WEPM_MODEL=tencent/WePocketModel1.0-2B bash examples/cpu/generation/run.sh single_text```-#### Structured decision+For GGUF on CPU, use the same CPU PyTorch build, install the optional dependencies, and build the native runtime. The build requires Git, CMake 3.20 or later, and a C++17 compiler.```bash-bash examples/gpu/decision/run.sh-```--### CPU inference--#### Generation: single text, single image, or interleaved content+python -m pip install -r inference/requirements-gguf.txt+python inference/build_gguf.py-```bash-bash examples/cpu/generation/run.sh single_text-bash examples/cpu/generation/run.sh single_image-bash examples/cpu/generation/run.sh interleaved+WEPM_MODEL=tencent/WePocketModel1.0-4B-GGUF bash examples/cpu/generation/run.sh single_text```-#### Embedding extraction+The first run with a Hugging Face model ID downloads a complete snapshot into the Hub cache. To use a local copy, see the [checkpoint download instructions](checkpoints/README.md). The generation scripts also accept `single_image` and `interleaved`. See the [runnable examples](examples/README.md) for embeddings and decisions and the [inference guide](inference/README.md) for CLI flags, multimodal inputs, and raw training exports.-```bash-bash examples/cpu/embedding/run.sh-```--#### Structured decision+### Hardware and precision (4B)-```bash-bash examples/cpu/decision/run.sh-```+| Backend | Device | Precision | Memory guidance |+| --- | --- | --- | --- |+| Transformers | NVIDIA GPU | BF16 | ≈8.5 GiB of weights. 16 GiB VRAM recommended. |+| Transformers | CPU | FP32 | ≈17 GiB of weights. 24 GiB system RAM recommended. |+| GGUF | CPU | Q4_K_M or BF16 language weights, FP32 vision and task compute | The 4B Q4_K_M language file and shared multimodal weights occupy ≈3.19 GiB on disk. |-Each command writes a timestamped JSON result, releases the model, and exits. See the [inference guide](inference/README.md) for the CLI and ordered multimodal input format, and the [examples guide](examples/README.md) for all runnable cases.+Actual memory use depends on the input and context length. GGUF weight file size describes storage. Runtime RAM also includes the vision and task modules, context, and working buffers. See the [GGUF guide](inference/README.md#gguf-on-cpu) for variants and context settings.## Citationdiff --git a/checkpoints/README.md b/checkpoints/README.mdindex 1bdc65a..b467fe4 100644--- a/checkpoints/README.md+++ b/checkpoints/README.md@@ -1,19 +1,14 @@# WePM Checkpoints-The planned model releases are hosted separately from the GitLab inference code:+The 2B and 4B models each have a Transformers export and a GGUF bundle. The [model table](../README.md#model-weights) lists all four Hugging Face repositories.-| Size | Hugging Face / safetensors |-| --- | --- |-| 4B | [tencent/WePocketModel1.0-4B](https://huggingface.co/tencent/WePocketModel1.0-4B) |-| 2B | [tencent/WePocketModel1.0-2B](https://huggingface.co/tencent/WePocketModel1.0-2B) |--The default examples resolve `tencent/WePocketModel1.0-4B` through the Hugging Face cache. Downloads require the model repositories to be published. This directory can optionally hold local downloads:+Use `hf download` to download a complete snapshot into a local directory. For example, choose one of the following 4B formats.```bashhf download tencent/WePocketModel1.0-4B --local-dir checkpoints/WePocketModel1.0-4B-hf download tencent/WePocketModel1.0-2B --local-dir checkpoints/WePocketModel1.0-2B+hf download tencent/WePocketModel1.0-4B-GGUF --local-dir checkpoints/WePocketModel1.0-4B-GGUF```-Set `WEPM_MODEL` to the resulting local directory to run without network access. Download the complete export, including `runtime_sources/`, `unimodel_aux.safetensors`, the processor and tokenizer files, and the manifest. New model subdirectories under `checkpoints/` are ignored by Git.+Use the corresponding 2B repository ID and destination directory for 2B. Set `WEPM_MODEL` to the directory you downloaded, or pass it to the inference CLI with `--model`. Use the CPU entry point for a GGUF bundle. See the [inference guide](../inference/README.md) for setup and required files.-Model files are not tracked in this GitLab repository. Download weights from Hugging Face independently of cloning the inference code. Existing local exports are preserved on disk but excluded from Git tracking.+Git ignores local download directories under `checkpoints/`.diff --git a/examples/README.md b/examples/README.mdindex d6d90b5..9ad7e2a 100644--- a/examples/README.md+++ b/examples/README.md@@ -52,9 +52,9 @@ bash examples/cpu/embedding/run.shbash examples/cpu/decision/run.sh```-The scripts default to `tencent/WePocketModel1.0-4B`. The first online run downloads the complete Hugging Face snapshot; later runs reuse cached files. The corresponding model repository must be published before downloading.+The scripts default to `tencent/WePocketModel1.0-4B`. The first online run downloads the complete Hugging Face snapshot; later runs reuse cached files. See the [model table](../README.md#model-weights) for both formats.-To select the 2B release once available:+To select the 2B Transformers model:```bashexport WEPM_MODEL=tencent/WePocketModel1.0-2Bdiff --git a/inference/README.md b/inference/README.mdindex 5bbccee..c6bd689 100644--- a/inference/README.md+++ b/inference/README.md@@ -36,11 +36,11 @@ python -m pip install -r inference/requirements.txt## Model download and local directory-`--model` accepts a Hugging Face model repository ID or a local checkpoint directory. The default is `tencent/WePocketModel1.0-4B`. To switch between compatible 2B and 4B Transformers checkpoints, change `--model` to the desired checkpoint. On CPU, a directory containing a GGUF `bundle.json` selects the GGUF backend.+`--model` accepts a Hugging Face model repository ID or a local checkpoint directory. The default is `tencent/WePocketModel1.0-4B`. To switch between compatible 2B and 4B Transformers checkpoints, change `--model` to the desired checkpoint. On CPU, a snapshot or directory containing a GGUF `bundle.json` selects the GGUF backend. See the [model table](../README.md#model-weights) for the 2B and 4B repository IDs in both formats.Both backends use the Python runtime included in this inference repository by default. If an export requires custom task code, review its `runtime_sources/` directory and pass `--trust-model-code` to execute that code with your user permissions. This applies to local directories and Hub snapshots. For Hub models, use `--revision` with the commit you reviewed.-The first online run downloads a complete snapshot, including the auxiliary weights and runtime sources, into the standard Hugging Face cache. Later runs reuse cached files, but may check the repository for updates. Use `--revision` to pin a tag or commit, `--cache-dir` to select a cache location, and `--local-files-only` (or `HF_HUB_OFFLINE=1`) to prohibit network access. Downloads finish before the inference timeout starts and before CUDA resources are allocated. Download errors, including an unpublished repository or a missing offline cache, are not silently replaced by another model.+The first online run downloads a complete snapshot, including the auxiliary weights and runtime sources, into the standard Hugging Face cache. Later runs reuse cached files, but may check the repository for updates. Use `--revision` to pin a tag or commit, `--cache-dir` to select a cache location, and `--local-files-only` (or `HF_HUB_OFFLINE=1`) to prohibit network access. Downloads finish before the inference timeout starts and before CUDA resources are allocated.To download ahead of time into a local directory:@@ -81,7 +81,7 @@ python -m pip install -r inference/requirements-gguf.txtpython inference/build_gguf.py```-Use a complete WePM GGUF bundle with `bundle.json`, the language weights, `multimodal-BF16.gguf`, and the accompanying tokenizer, processor, and runtime assets.+Pass a GGUF Hugging Face repository ID, such as `tencent/WePocketModel1.0-4B-GGUF`, or a local directory. A complete WePM GGUF bundle contains `bundle.json`, the language weights, `multimodal-BF16.gguf`, and the accompanying tokenizer, processor, and runtime assets.```bashpython inference/infer_cpu.py --model /path/to/wepm-gguf --task both \