Weyaxi commited on
Commit
5eb9e5d
1 Parent(s): 52670a6

remove open pr for details repos

Browse files
Files changed (1) hide show
  1. app.py +6 -11
app.py CHANGED
@@ -72,19 +72,18 @@ def return_operation_details(from_model, to_model):
72
 
73
  return liste
74
 
75
- def commit(liste_requests, liste_results, liste_details, details_path, from_model, to_model):
76
  common_for_commits = {"commit_message": f"Renaming Model {from_model} to {to_model}", "repo_type": "dataset", "create_pr": True}
77
 
78
  request_commit = (create_commit(repo_id="open-llm-leaderboard/requests", operations=liste_requests, **common_for_commits))
79
  result_commit = (create_commit(repo_id="open-llm-leaderboard/results", operations=liste_results, **common_for_commits))
80
- details_commit = (create_commit(repo_id="/".join(details_path.split("/")[1:]), operations=liste_details, **common_for_commits))
81
 
82
- all_commits = [request_commit, result_commit, details_commit]
83
- all_repo_ids = ["open-llm-leaderboard/requests", "open-llm-leaderboard/results", "/".join(details_path.split("/")[1:])]
84
 
85
  # Edit comment descriptions
86
 
87
- content = f"{request_commit.pr_url}\n{result_commit.pr_url}\n{details_commit.pr_url}"
88
 
89
  content = f"""This is a pull request aiming to rename the model {from_model} to {to_model}. All related pull requests to rename this model can be found below.
90
  # Requests
@@ -94,10 +93,6 @@ def commit(liste_requests, liste_results, liste_details, details_path, from_mode
94
  # Results
95
 
96
  {result_commit.pr_url}
97
-
98
- # Details
99
-
100
- {details_commit.pr_url}
101
  """
102
 
103
  for i, common_repo_id in enumerate(all_repo_ids):
@@ -108,13 +103,13 @@ def commit(liste_requests, liste_results, liste_details, details_path, from_mode
108
  edit_discussion_comment(**common_for_edits, comment_id=comment_id, new_content=content)
109
 
110
 
111
- return f"{request_commit.pr_url}\n{result_commit.pr_url}\n{details_commit.pr_url}"
112
 
113
 
114
  def commit_gradio(from_model, to_model, hf_token):
115
  try:
116
  login(hf_token)
117
- return commit(return_operation_requests(from_model, to_model), return_operation_results(from_model, to_model), return_operation_details(from_model, to_model), model_name_to_details(from_model), from_model, to_model)
118
  except Exception as e:
119
  return e
120
 
 
72
 
73
  return liste
74
 
75
+ def commit(liste_requests, liste_results, from_model, to_model):
76
  common_for_commits = {"commit_message": f"Renaming Model {from_model} to {to_model}", "repo_type": "dataset", "create_pr": True}
77
 
78
  request_commit = (create_commit(repo_id="open-llm-leaderboard/requests", operations=liste_requests, **common_for_commits))
79
  result_commit = (create_commit(repo_id="open-llm-leaderboard/results", operations=liste_results, **common_for_commits))
 
80
 
81
+ all_commits = [request_commit, result_commit]
82
+ all_repo_ids = ["open-llm-leaderboard/requests", "open-llm-leaderboard/results"]
83
 
84
  # Edit comment descriptions
85
 
86
+ content = f"{request_commit.pr_url}\n{result_commit.pr_url}"
87
 
88
  content = f"""This is a pull request aiming to rename the model {from_model} to {to_model}. All related pull requests to rename this model can be found below.
89
  # Requests
 
93
  # Results
94
 
95
  {result_commit.pr_url}
 
 
 
 
96
  """
97
 
98
  for i, common_repo_id in enumerate(all_repo_ids):
 
103
  edit_discussion_comment(**common_for_edits, comment_id=comment_id, new_content=content)
104
 
105
 
106
+ return f"{request_commit.pr_url}\n{result_commit.pr_url}"
107
 
108
 
109
  def commit_gradio(from_model, to_model, hf_token):
110
  try:
111
  login(hf_token)
112
+ return commit(return_operation_requests(from_model, to_model), return_operation_results(from_model, to_model), from_model, to_model)
113
  except Exception as e:
114
  return e
115