15
15
16
16
GIT_UP_TO_DATE = "On branch main\n Your branch is up to date with 'origin/main'.\
17
17
\n \n nothing to commit, working tree clean\n "
18
+ GIT_USER = os .getenv ("GIT_USER" , None )
19
+ GIT_EMAIL = os .getenv ("GIT_EMAIL" , None )
18
20
19
21
COMMIT_PLACEHOLDER = "{COMMIT_PLACEHOLDER}"
20
22
21
23
def _http_ci_user_agent (* args , ** kwargs ):
22
24
ua = _http_user_agent (* args , ** kwargs )
23
25
return ua + os .environ .get ("CI_HEADERS" , "" )
24
26
25
- huggingface_hub .utils ._headers ._http_user_agent = _http_ci_user_agent
26
-
27
27
28
28
def get_git_tag (lib_path , commit_hash ):
29
29
# 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):
85
85
# make sure we don't accidentally expose token
86
86
raise OSError (f"Could not clone from '{ clean_repo_url } '" )
87
87
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 )
89
89
90
90
copy_recursive (module_path , repo_path / module_name )
91
91
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):
108
108
109
109
110
110
if __name__ == "__main__" :
111
+ huggingface_hub .utils ._headers ._http_user_agent = _http_ci_user_agent
111
112
evaluation_paths = ["metrics" , "comparisons" , "measurements" ]
112
113
evaluation_types = ["metric" , "comparison" , "measurement" ]
113
114
0 commit comments