Created
December 8, 2025 15:09
-
-
Save monday8am/d9a89c08a81f2746aba3981ee0c98015 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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