Spaces:
Sleeping
Sleeping
Commit
·
472609c
1
Parent(s):
d403909
Good updates
Browse files
app.py
CHANGED
@@ -14,21 +14,13 @@ FEATURE_COLUMNS = None
|
|
14 |
|
15 |
def load_model():
|
16 |
"""Load the ONNX model and get input features"""
|
17 |
-
global MODEL
|
18 |
try:
|
19 |
model_path = Path("model/rd2l_forest.onnx")
|
20 |
if not model_path.exists():
|
21 |
return "Model file not found at: " + str(model_path)
|
22 |
|
23 |
MODEL = ort.InferenceSession(str(model_path))
|
24 |
-
|
25 |
-
# Use the known list of features
|
26 |
-
FEATURE_COLUMNS = ['mmr', 'p1', 'p2', 'p3', 'p4', 'p5', 'count', 'mean', 'std', 'min', 'max',
|
27 |
-
'sum', 'total_games_played', 'total_winrate'] + \
|
28 |
-
[f'games_{i}' for i in range(1, 139)] + \
|
29 |
-
[f'winrate_{i}' for i in range(1, 139)]
|
30 |
-
|
31 |
-
print(f"Number of features loaded: {len(FEATURE_COLUMNS)}")
|
32 |
return "Model loaded successfully"
|
33 |
except Exception as e:
|
34 |
return f"Error loading model: {str(e)}"
|
|
|
14 |
|
15 |
def load_model():
|
16 |
"""Load the ONNX model and get input features"""
|
17 |
+
global MODEL
|
18 |
try:
|
19 |
model_path = Path("model/rd2l_forest.onnx")
|
20 |
if not model_path.exists():
|
21 |
return "Model file not found at: " + str(model_path)
|
22 |
|
23 |
MODEL = ort.InferenceSession(str(model_path))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
return "Model loaded successfully"
|
25 |
except Exception as e:
|
26 |
return f"Error loading model: {str(e)}"
|