Skip to content

A compact, unified multimodal model family with a single shared vision–language backbone, built for on-device and in-app intelligence.

Separate inference scripts from demo data

xiaoyuan19965574ba5afc17
diff --git a/examples/README.md b/examples/README.md
index 28f8562..888f05f 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -5,24 +5,32 @@ The runnable examples are grouped by device. Each device directory contains gene
```text
examples/
├── gpu/
-│ ├── assets/
+│ ├── demo_data/
+│ │ ├── images/
+│ │ ├── generation/
+│ │ └── decision/
│ ├── generation/
│ ├── embedding/
│ └── decision/
└── cpu/
- ├── assets/
+ ├── demo_data/
+ │ ├── images/
+ │ ├── generation/
+ │ └── decision/
├── generation/
├── embedding/
└── decision/
```
+Task directories contain only runnable shell scripts. All JSON requests and image inputs live under the device-specific `demo_data/` directory.
+
The generation examples cover all supported input layouts:
- `single_text`: one text item
- `single_image`: one image item
- `interleaved`: text → image → text → image → text
-The original HEIC images are preserved byte-for-byte in each device's `assets/` directory. The inference dependencies include `pillow-heif` for decoding them.
+The original HEIC images are preserved byte-for-byte in each device's `demo_data/images/` directory. The inference dependencies include `pillow-heif` for decoding them.
## NVIDIA GPU
diff --git a/examples/cpu/decision/run.sh b/examples/cpu/decision/run.sh
index 334fb13..5990989 100755
--- a/examples/cpu/decision/run.sh
+++ b/examples/cpu/decision/run.sh
@@ -8,6 +8,6 @@ OUTPUT_DIR="${WEPM_OUTPUT_DIR:-$SCRIPT_DIR/results}"
mkdir -p "$OUTPUT_DIR"
python "$REPO_ROOT/inference/infer_cpu.py" \
- --model "$MODEL" --task decision --decision-json "$SCRIPT_DIR/request.json" \
+ --model "$MODEL" --task decision --decision-json "$SCRIPT_DIR/../demo_data/decision/request.json" \
--threads "${WEPM_THREADS:-8}" \
--output "$OUTPUT_DIR/choice-$(date -u +%Y%m%dT%H%M%SZ).json"
diff --git a/examples/cpu/decision/request.json b/examples/cpu/demo_data/decision/request.json
similarity index 100%
rename from examples/cpu/decision/request.json
rename to examples/cpu/demo_data/decision/request.json
diff --git a/examples/cpu/generation/interleaved.json b/examples/cpu/demo_data/generation/interleaved.json
similarity index 84%
rename from examples/cpu/generation/interleaved.json
rename to examples/cpu/demo_data/generation/interleaved.json
index 62e3c72..166452c 100644
--- a/examples/cpu/generation/interleaved.json
+++ b/examples/cpu/demo_data/generation/interleaved.json
@@ -6,7 +6,7 @@
},
{
"type": "image",
- "path": "../assets/img2.heic"
+ "path": "../images/img2.heic"
},
{
"type": "text",
@@ -14,7 +14,7 @@
},
{
"type": "image",
- "path": "../assets/img3.heic"
+ "path": "../images/img3.heic"
},
{
"type": "text",
diff --git a/examples/cpu/generation/single_image.json b/examples/cpu/demo_data/generation/single_image.json
similarity index 61%
rename from examples/cpu/generation/single_image.json
rename to examples/cpu/demo_data/generation/single_image.json
index 5ccd4af..32d3375 100644
--- a/examples/cpu/generation/single_image.json
+++ b/examples/cpu/demo_data/generation/single_image.json
@@ -2,7 +2,7 @@
"content": [
{
"type": "image",
- "path": "../assets/img3.heic"
+ "path": "../images/img3.heic"
}
]
}
diff --git a/examples/cpu/generation/single_text.json b/examples/cpu/demo_data/generation/single_text.json
similarity index 100%
rename from examples/cpu/generation/single_text.json
rename to examples/cpu/demo_data/generation/single_text.json
diff --git a/examples/cpu/assets/img2.heic b/examples/cpu/demo_data/images/img2.heic
similarity index 100%
rename from examples/cpu/assets/img2.heic
rename to examples/cpu/demo_data/images/img2.heic
diff --git a/examples/cpu/assets/img3.heic b/examples/cpu/demo_data/images/img3.heic
similarity index 100%
rename from examples/cpu/assets/img3.heic
rename to examples/cpu/demo_data/images/img3.heic
diff --git a/examples/cpu/embedding/run.sh b/examples/cpu/embedding/run.sh
index 864550e..9f84acb 100755
--- a/examples/cpu/embedding/run.sh
+++ b/examples/cpu/embedding/run.sh
@@ -4,7 +4,7 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
MODEL="${WEPM_MODEL:-$REPO_ROOT/checkpoints/huggingface}"
-INPUT="$SCRIPT_DIR/../generation/single_image.json"
+INPUT="$SCRIPT_DIR/../demo_data/generation/single_image.json"
OUTPUT_DIR="${WEPM_OUTPUT_DIR:-$SCRIPT_DIR/results}"
mkdir -p "$OUTPUT_DIR"
diff --git a/examples/cpu/generation/run.sh b/examples/cpu/generation/run.sh
index 9ce676e..da8644a 100755
--- a/examples/cpu/generation/run.sh
+++ b/examples/cpu/generation/run.sh
@@ -5,7 +5,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
MODEL="${WEPM_MODEL:-$REPO_ROOT/checkpoints/huggingface}"
CASE="${1:-single_text}"
-INPUT="$SCRIPT_DIR/$CASE.json"
+INPUT="$SCRIPT_DIR/../demo_data/generation/$CASE.json"
OUTPUT_DIR="${WEPM_OUTPUT_DIR:-$SCRIPT_DIR/results}"
if [[ ! -f "$INPUT" ]]; then
diff --git a/examples/gpu/decision/run.sh b/examples/gpu/decision/run.sh
index 14c7de7..ab420e2 100755
--- a/examples/gpu/decision/run.sh
+++ b/examples/gpu/decision/run.sh
@@ -8,5 +8,5 @@ OUTPUT_DIR="${WEPM_OUTPUT_DIR:-$SCRIPT_DIR/results}"
mkdir -p "$OUTPUT_DIR"
CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES:-0}" python "$REPO_ROOT/inference/infer.py" \
- --model "$MODEL" --task decision --decision-json "$SCRIPT_DIR/request.json" \
+ --model "$MODEL" --task decision --decision-json "$SCRIPT_DIR/../demo_data/decision/request.json" \
--output "$OUTPUT_DIR/choice-$(date -u +%Y%m%dT%H%M%SZ).json"
diff --git a/examples/gpu/decision/request.json b/examples/gpu/demo_data/decision/request.json
similarity index 100%
rename from examples/gpu/decision/request.json
rename to examples/gpu/demo_data/decision/request.json
diff --git a/examples/gpu/generation/interleaved.json b/examples/gpu/demo_data/generation/interleaved.json
similarity index 84%
rename from examples/gpu/generation/interleaved.json
rename to examples/gpu/demo_data/generation/interleaved.json
index 62e3c72..166452c 100644
--- a/examples/gpu/generation/interleaved.json
+++ b/examples/gpu/demo_data/generation/interleaved.json
@@ -6,7 +6,7 @@
},
{
"type": "image",
- "path": "../assets/img2.heic"
+ "path": "../images/img2.heic"
},
{
"type": "text",
@@ -14,7 +14,7 @@
},
{
"type": "image",
- "path": "../assets/img3.heic"
+ "path": "../images/img3.heic"
},
{
"type": "text",
diff --git a/examples/gpu/generation/single_image.json b/examples/gpu/demo_data/generation/single_image.json
similarity index 61%
rename from examples/gpu/generation/single_image.json
rename to examples/gpu/demo_data/generation/single_image.json
index 5ccd4af..32d3375 100644
--- a/examples/gpu/generation/single_image.json
+++ b/examples/gpu/demo_data/generation/single_image.json
@@ -2,7 +2,7 @@
"content": [
{
"type": "image",
- "path": "../assets/img3.heic"
+ "path": "../images/img3.heic"
}
]
}
diff --git a/examples/gpu/generation/single_text.json b/examples/gpu/demo_data/generation/single_text.json
similarity index 100%
rename from examples/gpu/generation/single_text.json
rename to examples/gpu/demo_data/generation/single_text.json
diff --git a/examples/gpu/assets/img2.heic b/examples/gpu/demo_data/images/img2.heic
similarity index 100%
rename from examples/gpu/assets/img2.heic
rename to examples/gpu/demo_data/images/img2.heic
diff --git a/examples/gpu/assets/img3.heic b/examples/gpu/demo_data/images/img3.heic
similarity index 100%
rename from examples/gpu/assets/img3.heic
rename to examples/gpu/demo_data/images/img3.heic
diff --git a/examples/gpu/embedding/run.sh b/examples/gpu/embedding/run.sh
index 5e0cbb3..b5ecce8 100755
--- a/examples/gpu/embedding/run.sh
+++ b/examples/gpu/embedding/run.sh
@@ -4,7 +4,7 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
MODEL="${WEPM_MODEL:-$REPO_ROOT/checkpoints/huggingface}"
-INPUT="$SCRIPT_DIR/../generation/single_image.json"
+INPUT="$SCRIPT_DIR/../demo_data/generation/single_image.json"
OUTPUT_DIR="${WEPM_OUTPUT_DIR:-$SCRIPT_DIR/results}"
mkdir -p "$OUTPUT_DIR"
diff --git a/examples/gpu/generation/run.sh b/examples/gpu/generation/run.sh
index 7737b6c..87ab08f 100755
--- a/examples/gpu/generation/run.sh
+++ b/examples/gpu/generation/run.sh
@@ -5,7 +5,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
MODEL="${WEPM_MODEL:-$REPO_ROOT/checkpoints/huggingface}"
CASE="${1:-single_text}"
-INPUT="$SCRIPT_DIR/$CASE.json"
+INPUT="$SCRIPT_DIR/../demo_data/generation/$CASE.json"
OUTPUT_DIR="${WEPM_OUTPUT_DIR:-$SCRIPT_DIR/results}"
if [[ ! -f "$INPUT" ]]; then
diff --git a/inference/README.md b/inference/README.md
index 11e05dd..f7f1ab4 100644
--- a/inference/README.md
+++ b/inference/README.md
@@ -75,9 +75,9 @@ Use `--content-json` when text and images must retain an explicit order. Relativ
{
"content": [
{"type": "text", "text": "Inspect the first image:"},
- {"type": "image", "path": "../assets/first.heic"},
+ {"type": "image", "path": "../images/first.heic"},
{"type": "text", "text": "Compare it with the second image:"},
- {"type": "image", "path": "../assets/second.heic"},
+ {"type": "image", "path": "../images/second.heic"},
{"type": "text", "text": "Summarize the differences."}
]
}
@@ -97,7 +97,7 @@ CUDA_VISIBLE_DEVICES=0 python inference/infer.py \
```bash
CUDA_VISIBLE_DEVICES=0 python inference/infer.py \
--model checkpoints/huggingface --task decision \
- --decision-json examples/gpu/decision/request.json \
+ --decision-json examples/gpu/demo_data/decision/request.json \
--output results/decision.json
```