Upload folder using huggingface_hub
Browse files- .DS_Store +0 -0
- .gitattributes +1 -0
- minires.keras +1 -1
- minires.py +6 -5
- minires_meta.json +13 -0
- minires_xgb.json +3 -0
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
.gitattributes
CHANGED
|
@@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
minires.keras filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
minires.keras filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
minires_xgb.json filter=lfs diff=lfs merge=lfs -text
|
minires.keras
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 9741158
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ade3b309ca10520d90ca79c267d6472c6ee9ff4d0436e288d7ff4f14053e4f7
|
| 3 |
size 9741158
|
minires.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
# minires.py
|
| 2 |
|
| 3 |
import json
|
| 4 |
-
import joblib
|
| 5 |
import numpy as np
|
| 6 |
import pandas as pd
|
| 7 |
from pathlib import Path
|
| 8 |
from tensorflow.keras.models import load_model
|
|
|
|
| 9 |
from huggingface_hub import hf_hub_download
|
| 10 |
|
| 11 |
|
|
@@ -16,8 +16,8 @@ from huggingface_hub import hf_hub_download
|
|
| 16 |
REPO_ID = "nicolamustone/minires"
|
| 17 |
|
| 18 |
NN_FILENAME = "minires.keras"
|
| 19 |
-
XGB_FILENAME = "
|
| 20 |
-
META_FILENAME = "
|
| 21 |
|
| 22 |
|
| 23 |
# ---------------------------------------------------------------------
|
|
@@ -61,9 +61,10 @@ class minires:
|
|
| 61 |
**download_kwargs,
|
| 62 |
)
|
| 63 |
|
| 64 |
-
# For inference we don't need optimizer state
|
| 65 |
self.nn = load_model(self.nn_path, compile=False)
|
| 66 |
-
self.xgb =
|
|
|
|
|
|
|
| 67 |
|
| 68 |
with open(self.meta_path, "r") as f:
|
| 69 |
meta = json.load(f)
|
|
|
|
| 1 |
# minires.py
|
| 2 |
|
| 3 |
import json
|
|
|
|
| 4 |
import numpy as np
|
| 5 |
import pandas as pd
|
| 6 |
from pathlib import Path
|
| 7 |
from tensorflow.keras.models import load_model
|
| 8 |
+
from xgboost import XGBRegressor
|
| 9 |
from huggingface_hub import hf_hub_download
|
| 10 |
|
| 11 |
|
|
|
|
| 16 |
REPO_ID = "nicolamustone/minires"
|
| 17 |
|
| 18 |
NN_FILENAME = "minires.keras"
|
| 19 |
+
XGB_FILENAME = "minires_xgb.json"
|
| 20 |
+
META_FILENAME = "minires_meta.json"
|
| 21 |
|
| 22 |
|
| 23 |
# ---------------------------------------------------------------------
|
|
|
|
| 61 |
**download_kwargs,
|
| 62 |
)
|
| 63 |
|
|
|
|
| 64 |
self.nn = load_model(self.nn_path, compile=False)
|
| 65 |
+
self.xgb = XGBRegressor()
|
| 66 |
+
|
| 67 |
+
self.xgb.load_model(self.xgb_path)
|
| 68 |
|
| 69 |
with open(self.meta_path, "r") as f:
|
| 70 |
meta = json.load(f)
|
minires_meta.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"w_nn": 0.35000000000000003,
|
| 3 |
+
"features": [
|
| 4 |
+
"artist",
|
| 5 |
+
"volume",
|
| 6 |
+
"mass",
|
| 7 |
+
"volume_mass_interaction",
|
| 8 |
+
"surface_volume_ratio",
|
| 9 |
+
"surface_mass_ratio",
|
| 10 |
+
"base_mm",
|
| 11 |
+
"euler_number"
|
| 12 |
+
]
|
| 13 |
+
}
|
minires_xgb.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:93399051e31020cdf57dba9dda2f51fcd55ca03ed78194877e8d70c3911471ca
|
| 3 |
+
size 17584077
|