Skip to content

Instantly share code, notes, and snippets.

@monday8am
Created December 8, 2025 15:09
Show Gist options
  • Select an option

  • Save monday8am/d9a89c08a81f2746aba3981ee0c98015 to your computer and use it in GitHub Desktop.

Select an option

Save monday8am/d9a89c08a81f2746aba3981ee0c98015 to your computer and use it in GitHub Desktop.
# STEP 6.5 — Build .task bundle using MediaPipe
import os
import mediapipe as mp
from mediapipe.tasks.python.genai import bundler
# Configure the bundle
# Hammer2.1 uses Qwen2.5's tokenizer with ChatML format
task_config = bundler.BundleConfig(
tflite_model=OUTPUT_TFLITE,
tokenizer_model=OUTPUT_SPM,
start_token="<|im_start|>",
stop_tokens=["<|im_end|>", "<|endoftext|>"],
output_filename=OUTPUT_TASK,
enable_bytes_to_unicode_mapping=False, # Required for Qwen-based tokenizers
)
# Build the bundle
bundler.create_bundle(task_config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment