Spaces:
Runtime error
Runtime error
No more restarting space, fixed format
Browse files
app.py
CHANGED
|
@@ -38,16 +38,18 @@ modelQueue = []
|
|
| 38 |
def restart_space(): #Most dumbest update function to ever exist, I'm sobbing in tears as I've tried to make gradio update the leaderboard literally any other way.
|
| 39 |
API.restart_space(repo_id=REPO_ID, token=H4_TOKEN)
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
def save_to_txt(model, results, model_type):
|
| 43 |
file_path = "data/code_eval_board.csv"
|
| 44 |
|
| 45 |
with open(file_path, "a") as f:
|
| 46 |
-
f.write(f"\n{model_type},{model}," + str(results["arc"]) + "," + str(results["hellaswag"]) + "," + str(results["mmlu"]) + "," + str(results["truthfulQA"]) + "," + str(results["winogrande"]) + "," + str(results["gsm8k"]))
|
| 47 |
f.close()
|
| 48 |
|
| 49 |
-
restart_space()
|
| 50 |
-
|
| 51 |
def run_test(model,ref_model,data):
|
| 52 |
print(f"|| TESTING {data} ||")
|
| 53 |
return evaluator.main(
|
|
|
|
| 38 |
def restart_space(): #Most dumbest update function to ever exist, I'm sobbing in tears as I've tried to make gradio update the leaderboard literally any other way.
|
| 39 |
API.restart_space(repo_id=REPO_ID, token=H4_TOKEN)
|
| 40 |
|
| 41 |
+
def formatr(result):
|
| 42 |
+
result = result.split(",")[2].replace(")","")
|
| 43 |
+
result = result.replace(" ","")
|
| 44 |
+
return result
|
| 45 |
|
| 46 |
def save_to_txt(model, results, model_type):
|
| 47 |
file_path = "data/code_eval_board.csv"
|
| 48 |
|
| 49 |
with open(file_path, "a") as f:
|
| 50 |
+
f.write(f"\n{model_type},{model}," + str(formatr(results["arc"])) + "," + str(formatr(results["hellaswag"])) + "," + str(formatr(results["mmlu"])) + "," + str(formatr(results["truthfulQA"])) + "," + str(formatr(results["winogrande"])) + "," + str(formatr(results["gsm8k"])))
|
| 51 |
f.close()
|
| 52 |
|
|
|
|
|
|
|
| 53 |
def run_test(model,ref_model,data):
|
| 54 |
print(f"|| TESTING {data} ||")
|
| 55 |
return evaluator.main(
|