Spaces:
Sleeping
Sleeping
Jimin Park
commited on
Commit
·
97a08ff
1
Parent(s):
f067acf
kermitting soon
Browse files- util/app.py +3 -1
- util/app_training_df_getter.py +4 -5
util/app.py
CHANGED
@@ -67,6 +67,8 @@ def show_stats(player_opgg_url):
|
|
67 |
|
68 |
try:
|
69 |
training_features = get_user_training_df(player_opgg_url)
|
|
|
|
|
70 |
|
71 |
if isinstance(training_features, str): # Error message
|
72 |
return training_features, None
|
@@ -92,7 +94,7 @@ def show_stats(player_opgg_url):
|
|
92 |
|
93 |
return stats_html, None
|
94 |
except Exception as e:
|
95 |
-
return f"Error processing stats: {e}", None
|
96 |
|
97 |
def predict_champion(player_opgg_url, *champions):
|
98 |
"""Make prediction based on selected champions"""
|
|
|
67 |
|
68 |
try:
|
69 |
training_features = get_user_training_df(player_opgg_url)
|
70 |
+
|
71 |
+
print("training_features: ", training_features, "\n")
|
72 |
|
73 |
if isinstance(training_features, str): # Error message
|
74 |
return training_features, None
|
|
|
94 |
|
95 |
return stats_html, None
|
96 |
except Exception as e:
|
97 |
+
return f"Error processing stats: {e}. ", None
|
98 |
|
99 |
def predict_champion(player_opgg_url, *champions):
|
100 |
"""Make prediction based on selected champions"""
|
util/app_training_df_getter.py
CHANGED
@@ -437,7 +437,6 @@ def create_app_user_training_df(url):
|
|
437 |
#meta_stats = get_meta_stats()
|
438 |
weekly_meta_stats = get_weekly_meta()
|
439 |
|
440 |
-
'''
|
441 |
# Input validation
|
442 |
if not url or not isinstance(url, str):
|
443 |
raise ValueError("Invalid URL provided")
|
@@ -504,7 +503,7 @@ def create_app_user_training_df(url):
|
|
504 |
|
505 |
print("Training features created successfully")
|
506 |
return training_features
|
507 |
-
|
508 |
except Exception as e:
|
509 |
import traceback
|
510 |
error_trace = traceback.format_exc()
|
@@ -523,7 +522,7 @@ def create_app_user_training_df(url):
|
|
523 |
|
524 |
|
525 |
#url = "https://www.op.gg/summoners/euw/Agurin-EUW"
|
526 |
-
url = "https://www.op.gg/summoners/euw/Agurin-EUW?queue_type=TOTAL"
|
527 |
-
return_value = create_app_user_training_df(url)
|
528 |
-
print("type(Return_value):", type(return_value), "\n return value: \n", return_value)
|
529 |
|
|
|
437 |
#meta_stats = get_meta_stats()
|
438 |
weekly_meta_stats = get_weekly_meta()
|
439 |
|
|
|
440 |
# Input validation
|
441 |
if not url or not isinstance(url, str):
|
442 |
raise ValueError("Invalid URL provided")
|
|
|
503 |
|
504 |
print("Training features created successfully")
|
505 |
return training_features
|
506 |
+
|
507 |
except Exception as e:
|
508 |
import traceback
|
509 |
error_trace = traceback.format_exc()
|
|
|
522 |
|
523 |
|
524 |
#url = "https://www.op.gg/summoners/euw/Agurin-EUW"
|
525 |
+
#url = "https://www.op.gg/summoners/euw/Agurin-EUW?queue_type=TOTAL"
|
526 |
+
#return_value = create_app_user_training_df(url)
|
527 |
+
#print("type(Return_value):", type(return_value), "\n return value: \n", return_value)
|
528 |
|