Download OptGuideOnDeviceModel/V1/test.py from dejanseo/chrome_models: direct link, hf CLI and curl.
- Browser
- Download file 880 Bytes
-
https://huggingface.co/dejanseo/chrome_models/resolve/refs%2Fpr%2F9/OptGuideOnDeviceModel/V1/test.py
- Command line
-
hf download hf://dejanseo/chrome_models@refs/pr/9/OptGuideOnDeviceModel/V1/test.py
-
curl -L -o test.py https://huggingface.co/dejanseo/chrome_models/resolve/refs%2Fpr%2F9/OptGuideOnDeviceModel/V1/test.py
880 Bytes
| from ai_edge_torch import EdgeModel | |
| import torch | |
| def inspect_model(): | |
| try: | |
| # Load the model using AI Edge Runtime | |
| model = EdgeModel.from_file("./model.tflite") | |
| print("\n=== Model Information ===") | |
| print(f"Model loaded successfully") | |
| # Get model properties | |
| print("\nModel Properties:") | |
| print(f"Device: {model.device}") | |
| # Try to get input/output information | |
| print("\nModel Structure:") | |
| print(model) | |
| return model | |
| except Exception as e: | |
| print(f"\nError loading model: {str(e)}") | |
| return None | |
| def main(): | |
| print("PyTorch version:", torch.__version__) | |
| print("Starting model inspection...") | |
| model = inspect_model() | |
| if model: | |
| print("\nModel loaded successfully!") | |
| if __name__ == "__main__": | |
| main() |