Spaces:
Runtime error
Runtime error
Download app/utils/model_loader.py from bxntang/pi-cnn-model: direct link, hf CLI and curl.
- Browser
- Download file 316 Bytes
-
https://huggingface.co/spaces/bxntang/pi-cnn-model/resolve/main/app/utils/model_loader.py
- Command line
-
hf download hf://spaces/bxntang/pi-cnn-model/app/utils/model_loader.py
-
curl -L -o model_loader.py https://huggingface.co/spaces/bxntang/pi-cnn-model/resolve/main/app/utils/model_loader.py
316 Bytes
| import tensorflow as tf # type: ignore | |
| from functools import lru_cache | |
| from app.config import MODEL_PATH | |
| def load_model(): | |
| try: | |
| model = tf.keras.models.load_model(MODEL_PATH) | |
| return model | |
| except Exception as e: | |
| raise RuntimeError(f"❌ Gagal load model: {e}") | |