Spaces:
Sleeping
Sleeping
Download Model_Load.py from omanaaja/HistoryLens: direct link, hf CLI and curl.
- Browser
- Download file 381 Bytes
-
https://huggingface.co/spaces/omanaaja/HistoryLens/resolve/main/Model_Load.py
- Command line
-
hf download hf://spaces/omanaaja/HistoryLens/Model_Load.py
-
curl -L -o Model_Load.py https://huggingface.co/spaces/omanaaja/HistoryLens/resolve/main/Model_Load.py
381 Bytes
| from keras.models import model_from_json | |
| def load_model_from_files(json_path, weights_path): | |
| with open(json_path, "r") as json_file: | |
| loaded_model_json = json_file.read() | |
| model = model_from_json(loaded_model_json) | |
| model.load_weights(weights_path) | |
| model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy']) | |
| return model | |