Created
December 8, 2025 14:08
-
-
Save monday8am/cb56181c8e205ec4025596a1a2a7cd28 to your computer and use it in GitHub Desktop.
Conversion script to .tflite format
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 4 — Convert to TFLite with quantization | |
| hammer_converter = "/content/ai-edge-torch/ai_edge_torch/generative/examples/hammer/convert_to_tflite.py" | |
| qwen3_converter = "/content/ai-edge-torch/ai_edge_torch/generative/examples/qwen/convert_v3_to_tflite.py" | |
| if MODEL_NAME == HAMMER2P1: | |
| print("✅ Using Hammer-specific converter") | |
| converter_script = hammer_converter | |
| else: | |
| print("✅ Using Qwen3-specific converter") | |
| converter_script = qwen3_converter | |
| !python {converter_script} \ | |
| --checkpoint_path "{checkpoint_path}" \ | |
| --model_size "{MODEL_SIZE}" \ | |
| --output_path "/content/" \ | |
| --output_name_prefix "{OUTPUT_PREFIX}" \ | |
| --kv_cache_max_len {CONTEXT_LENGTH} \ | |
| --quantize "{QUANTIZATION}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment