Instructions to use nadjla12/skyline-api with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use nadjla12/skyline-api with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://nadjla12/skyline-api") - Notebooks
- Google Colab
- Kaggle
| import zipfile, json, shutil, os | |
| src = "models/best_model_p2.keras" | |
| dst = "models/best_model_fixed.keras" | |
| if os.path.exists(dst): | |
| os.remove(dst) | |
| shutil.copy(src, dst) | |
| with zipfile.ZipFile(dst, "r") as z: | |
| buffers = {n: z.read(n) for n in z.namelist()} | |
| cfg = json.loads(buffers["config.json"]) | |
| def clean(obj): | |
| if isinstance(obj, dict): | |
| obj.pop("quantization_config", None) | |
| for v in obj.values(): clean(v) | |
| elif isinstance(obj, list): | |
| for i in obj: clean(i) | |
| clean(cfg) | |
| buffers["config.json"] = json.dumps(cfg).encode() | |
| os.remove(dst) | |
| with zipfile.ZipFile(dst, "w", zipfile.ZIP_DEFLATED) as z: | |
| for n, d in buffers.items(): z.writestr(n, d) | |
| print("DONE") | |