Spaces:
Sleeping
Sleeping
no filename parameter error message
Browse files
app.py
CHANGED
|
@@ -391,10 +391,6 @@ def import_and_run_function(script_path, function_name, filename):
|
|
| 391 |
print("FUNCTION TO RUN")
|
| 392 |
print(function_to_run)
|
| 393 |
params = list(sig.parameters.values())
|
| 394 |
-
print("PARAMS")
|
| 395 |
-
print(params)
|
| 396 |
-
print("PARAMS LENGTH")
|
| 397 |
-
print(len(params))
|
| 398 |
if len(params) != 1 or params[0].kind not in [inspect.Parameter.POSITIONAL_OR_KEYWORD]:
|
| 399 |
set_error_message("Error: Function must have exactly one parameter (filepath).")
|
| 400 |
return None
|
|
@@ -494,6 +490,9 @@ def update_leaderboard(username, zip_file):
|
|
| 494 |
|
| 495 |
try:
|
| 496 |
updated_leaderboard = evaluate_model(username, python_script)
|
|
|
|
|
|
|
|
|
|
| 497 |
except Exception as e:
|
| 498 |
print("Error in eval mode:", str(e))
|
| 499 |
return f"Error evaluating model: {str(e)}", None
|
|
|
|
| 391 |
print("FUNCTION TO RUN")
|
| 392 |
print(function_to_run)
|
| 393 |
params = list(sig.parameters.values())
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
if len(params) != 1 or params[0].kind not in [inspect.Parameter.POSITIONAL_OR_KEYWORD]:
|
| 395 |
set_error_message("Error: Function must have exactly one parameter (filepath).")
|
| 396 |
return None
|
|
|
|
| 490 |
|
| 491 |
try:
|
| 492 |
updated_leaderboard = evaluate_model(username, python_script)
|
| 493 |
+
|
| 494 |
+
if update_leaderboard == None:
|
| 495 |
+
return None
|
| 496 |
except Exception as e:
|
| 497 |
print("Error in eval mode:", str(e))
|
| 498 |
return f"Error evaluating model: {str(e)}", None
|