Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse filesaddress the following error: remote: Password authentication in git is no longer supported. You must use a user access token or an SSH key instead. See https://huggingface.co/blog/password-git-deprecation
app.py
CHANGED
@@ -19,8 +19,8 @@ def validate_url(url):
|
|
19 |
def clone_repo(url, repo_dir, token):
|
20 |
env = os.environ.copy()
|
21 |
env['GIT_LFS_SKIP_SMUDGE'] = '1'
|
22 |
-
|
23 |
-
result = subprocess.run(
|
24 |
if result.returncode != 0:
|
25 |
return False, result.stderr
|
26 |
return True, None
|
|
|
19 |
def clone_repo(url, repo_dir, token):
|
20 |
env = os.environ.copy()
|
21 |
env['GIT_LFS_SKIP_SMUDGE'] = '1'
|
22 |
+
token_url = url.replace('https://', f'https://{token}:x-oauth-basic@')
|
23 |
+
result = subprocess.run(["git", "clone", token_url, repo_dir], env=env, capture_output=True, text=True)
|
24 |
if result.returncode != 0:
|
25 |
return False, result.stderr
|
26 |
return True, None
|