Abhaykoul commited on
Commit
85ea5d9
1 Parent(s): 1231b89

Update functions.py

Browse files
Files changed (1) hide show
  1. functions.py +2 -6
functions.py CHANGED
@@ -128,7 +128,7 @@ def get_edited_yaml_readme(repo, token: str | None):
128
  card = ModelCard.load(repo, token=token)
129
  results = search(df, repo)
130
 
131
- common = {"task_type": 'text-generation', "task_name": 'Text Generation', "source_name": "Open Portuguese LLM Leaderboard", "source_url": get_query_url(repo)}
132
 
133
  tasks_results = get_task_summary(results)
134
 
@@ -168,7 +168,6 @@ def commit(repo, pr_number=None, message="Adding Evaluation Results", oauth_toke
168
  if "Repo card metadata block was not found." in str(e): # There is no readme
169
  readme_text = get_edited_yaml_readme(repo, token=token)
170
  else:
171
- traceback.print_exc()
172
  print(f"Something went wrong: {e}")
173
 
174
  liste = [CommitOperationAdd(path_in_repo="README.md", path_or_fileobj=readme_text.encode())]
@@ -185,7 +184,4 @@ def commit(repo, pr_number=None, message="Adding Evaluation Results", oauth_toke
185
  elif "Repository Not Found" in str(e):
186
  return "Repository Not Found"
187
  else:
188
- return e
189
-
190
- if __name__ == "__main__":
191
- print(get_eval_results("Qwen/Qwen1.5-72B-Chat"))
 
128
  card = ModelCard.load(repo, token=token)
129
  results = search(df, repo)
130
 
131
+ common = {"task_type": 'text-generation', "task_name": 'Text Generation', "source_name": "Open LLM Leaderboard", "source_url": f"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query={repo}"}
132
 
133
  tasks_results = get_task_summary(results)
134
 
 
168
  if "Repo card metadata block was not found." in str(e): # There is no readme
169
  readme_text = get_edited_yaml_readme(repo, token=token)
170
  else:
 
171
  print(f"Something went wrong: {e}")
172
 
173
  liste = [CommitOperationAdd(path_in_repo="README.md", path_or_fileobj=readme_text.encode())]
 
184
  elif "Repository Not Found" in str(e):
185
  return "Repository Not Found"
186
  else:
187
+ return e