Install any skill in seconds. Free to start, no credit card required.
Get Started Free →google-ai-edge/converting-pytorch-to-litert
Converts PyTorch models (e.g. ResNet, timm, HuggingFace transformers) directly to LiteRT (.tflite) flatbuffer format.
Passed 19 of 20 test cases with the skill, and 3 of 20 without it.
and 32 more in the full report
18 fixed3 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 16 test cases the skill fixed. Same model, same prompt, with and without the skill.
When setting up the environment for converting a PyTorch Vision Transformer model from `timm` to `.tflite`, what specific LiteRT CLI package must be included in the `pip install` list?
| Checked | Without skill | With skill |
|---|---|---|
| Specifies litert-cli-nightly as the required CLI package | Missed | Passed |
| Specifies python3.11 for executing pip | Missed | Passed |
The instructions your model reads when the skill loads.
ATTENTION ALL AGENTS: If you are tasked with converting a PyTorch model (e.g., ResNet or similar architectures) to a .tflite flatbuffer format in this repository, you must strictly follow these rules based on recent project findings:
Bypass ONNX entirely. Do not attempt to export the model to ONNX or use onnx2tf. Convert directly from PyTorch to LiteRT.
litert-torchUse the litert-torch library for the direct PyTorch to TFLite conversion. Note that ai-edge-torch is deprecated and has been officially renamed to litert-torch.
torchao (AttributeError: 'typing.Union' object has no attribute '__module__').python3.11) as it is highly recommended for stability and avoids the aforementioned type hint bugs.Before running any conversion script, ensure the following are installed in your python3.11 environment:
python3.11 -m pip install torch transformers timm litert-torch ai-edge-litert litert-cli-nightly
test cases passed, vs 3 / 20 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.