Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ def remove_from(text, from_model, to_model):
|
|
13 |
|
14 |
|
15 |
def return_operation_requests(from_model, to_model):
|
16 |
-
ls = [i['name'] for i in fs.ls(path=f'datasets/
|
17 |
liste=[]
|
18 |
|
19 |
for i in range(len(ls)):
|
@@ -29,7 +29,7 @@ def return_operation_requests(from_model, to_model):
|
|
29 |
|
30 |
|
31 |
def return_operation_results(from_model, to_model):
|
32 |
-
ls = [i['name'] for i in fs.ls(path=f'datasets/
|
33 |
liste=[]
|
34 |
|
35 |
for i in range(len(ls)):
|
@@ -67,8 +67,8 @@ def return_operation_details(from_model, to_model):
|
|
67 |
return liste
|
68 |
|
69 |
def commit(liste_requests, liste_results, liste_details, details_path, from_model, to_model):
|
70 |
-
request_commit = (create_commit(repo_id="
|
71 |
-
result_commit = (create_commit(repo_id="
|
72 |
details_commit = (create_commit(repo_id="/".join(details_path.split("/")[1:]), operations=liste_details, commit_message=f"Renaming Model {from_model} to {to_model}", repo_type="dataset", create_pr=True).__dict__['pr_url'])
|
73 |
return request_commit, result_commit, details_commit
|
74 |
|
|
|
13 |
|
14 |
|
15 |
def return_operation_requests(from_model, to_model):
|
16 |
+
ls = [i['name'] for i in fs.ls(path=f'datasets/open-llm-leaderboard/requests/{from_model.split("/")[0]}') if from_model in i['name']]
|
17 |
liste=[]
|
18 |
|
19 |
for i in range(len(ls)):
|
|
|
29 |
|
30 |
|
31 |
def return_operation_results(from_model, to_model):
|
32 |
+
ls = [i['name'] for i in fs.ls(path=f'datasets/open-llm-leaderboard/results/{from_model}') if from_model in i['name']]
|
33 |
liste=[]
|
34 |
|
35 |
for i in range(len(ls)):
|
|
|
67 |
return liste
|
68 |
|
69 |
def commit(liste_requests, liste_results, liste_details, details_path, from_model, to_model):
|
70 |
+
request_commit = (create_commit(repo_id="open-llm-leaderboard/requests", operations=liste_requests, commit_message=f"Renaming Models {from_model} to {to_model}", repo_type="dataset", create_pr=True).__dict__['pr_url'])
|
71 |
+
result_commit = (create_commit(repo_id="open-llm-leaderboard/results", operations=liste_results, commit_message=f"Renaming Model {from_model} to {to_model}", repo_type="dataset", create_pr=True).__dict__['pr_url'])
|
72 |
details_commit = (create_commit(repo_id="/".join(details_path.split("/")[1:]), operations=liste_details, commit_message=f"Renaming Model {from_model} to {to_model}", repo_type="dataset", create_pr=True).__dict__['pr_url'])
|
73 |
return request_commit, result_commit, details_commit
|
74 |
|