fix: " in main.py
This commit is contained in:
@@ -97,7 +97,7 @@ def upload_score():
|
||||
@app.route("/get_scores/<project>", methods=["GET"])
|
||||
def get_scores(project):
|
||||
try:
|
||||
csv_file_path = get_csv_file_path(project) # 根据项目名称选择文件
|
||||
csv_file_path = get_csv_file_path(project)
|
||||
if not os.path.exists(csv_file_path):
|
||||
return jsonify([]) # 如果文件不存在,返回空列表
|
||||
|
||||
@@ -123,7 +123,7 @@ def get_scores(project):
|
||||
@app.route("/get_top_scores/<project>", methods=["GET"])
|
||||
def get_top_scores(project):
|
||||
try:
|
||||
csv_file_path = get_csv_file_path(project) # 根据项目名称选择文件
|
||||
csv_file_path = get_csv_file_path(project)
|
||||
if not os.path.exists(csv_file_path):
|
||||
return jsonify([]) # 如果文件不存在,返回空列表
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ def upload_score(name, id, score_data):
|
||||
},
|
||||
)
|
||||
if response.status_code == 200:
|
||||
print(f"{response.json()["message"]}")
|
||||
print(response.json()["message"])
|
||||
else:
|
||||
print("上传成绩失败!\n原因:", response.json()["message"])
|
||||
except Exception as e:
|
||||
|
||||
@@ -104,7 +104,7 @@ def upload_score(name, id, score_data):
|
||||
},
|
||||
)
|
||||
if response.status_code == 200:
|
||||
print(f"{response.json()["message"]}")
|
||||
print(response.json()["message"])
|
||||
else:
|
||||
print("上传成绩失败!\n原因:", response.json()["message"])
|
||||
except Exception as e:
|
||||
@@ -125,7 +125,7 @@ def main(name, id):
|
||||
log_details.append(f"Error loading user function: {e}")
|
||||
print("\n".join(log_details))
|
||||
return
|
||||
|
||||
|
||||
load_start_time = time.time()
|
||||
|
||||
# 加载数据集
|
||||
@@ -134,7 +134,6 @@ def main(name, id):
|
||||
|
||||
load_end_time = time.time()
|
||||
|
||||
|
||||
# 记录评估时间
|
||||
start_time = time.time()
|
||||
|
||||
@@ -150,7 +149,9 @@ def main(name, id):
|
||||
print("")
|
||||
log_details.append(f"得分: {accuracy * 100:.2f}")
|
||||
print(f"得分: {accuracy * 100:.2f}")
|
||||
log_details.append(f"加载数据集时间: {(load_end_time - load_start_time)*1000:.10f}ms")
|
||||
log_details.append(
|
||||
f"加载数据集时间: {(load_end_time - load_start_time)*1000:.10f}ms"
|
||||
)
|
||||
print(f"加载数据集时间: {(load_end_time - load_start_time)*1000:.10f}ms")
|
||||
log_details.append(f"运行时间: {running_time * 1000:.10f}ms")
|
||||
print(f"运行时间: {running_time * 1000:.10f}ms")
|
||||
|
||||
Reference in New Issue
Block a user