Skip to content

Commit bf2d482

Browse files
committed
again
1 parent 768141e commit bf2d482

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/hub/push_evaluations_to_hub.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515

1616
GIT_UP_TO_DATE = "On branch main\nYour branch is up to date with 'origin/main'.\
1717
\n\nnothing to commit, working tree clean\n"
18+
GIT_USER = os.getenv("GIT_USER", None)
19+
GIT_EMAIL = os.getenv("GIT_EMAIL", None)
1820

1921
COMMIT_PLACEHOLDER = "{COMMIT_PLACEHOLDER}"
2022

2123
def _http_ci_user_agent(*args, **kwargs):
2224
ua = _http_user_agent(*args, **kwargs)
2325
return ua + os.environ.get("CI_HEADERS", "")
2426

25-
huggingface_hub.utils._headers._http_user_agent = _http_ci_user_agent
26-
2727

2828
def get_git_tag(lib_path, commit_hash):
2929
# check if commit has a tag, see: https://stackoverflow.com/questions/1474115/how-to-find-the-tag-associated-with-a-given-git-commit
@@ -85,7 +85,7 @@ def push_module_to_hub(module_path, type, token, commit_hash, tag=None):
8585
# make sure we don't accidentally expose token
8686
raise OSError(f"Could not clone from '{clean_repo_url}'")
8787

88-
repo = Repository(local_dir=repo_path / module_name, token=token)
88+
repo = Repository(local_dir=repo_path / module_name, token=token, git_user=GIT_USER, git_email=GIT_EMAIL)
8989

9090
copy_recursive(module_path, repo_path / module_name)
9191
update_evaluate_dependency(repo_path / module_name / "requirements.txt", commit_hash)
@@ -108,6 +108,7 @@ def push_module_to_hub(module_path, type, token, commit_hash, tag=None):
108108

109109

110110
if __name__ == "__main__":
111+
huggingface_hub.utils._headers._http_user_agent = _http_ci_user_agent
111112
evaluation_paths = ["metrics", "comparisons", "measurements"]
112113
evaluation_types = ["metric", "comparison", "measurement"]
113114

.github/workflows/update_spaces.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
working-directory: ./.github/hub
3434
run: |
3535
export HF_TOKEN=${{ secrets.HF_HUB_TOKEN }}
36+
export GIT_USER=evaluate-bot
37+
export GIT_EMAIL=leandro@huggingface.co
3638
export EVALUATE_LIB_PATH=$GITHUB_WORKSPACE
3739
export GIT_HASH=$GITHUB_SHA
3840
export GIT_LFS_SKIP_SMUDGE=1

0 commit comments

Comments
 (0)