Allow huggingface.co URLs
Browse files- functions.py +3 -3
functions.py
CHANGED
|
@@ -264,15 +264,15 @@ def commit(
|
|
| 264 |
else:
|
| 265 |
token = oauth_token
|
| 266 |
|
| 267 |
-
with urllib3.PoolManager() as pool:
|
| 268 |
-
results = calculate_results(repo, pool)
|
| 269 |
-
|
| 270 |
if repo.startswith("https://huggingface.co/"):
|
| 271 |
try:
|
| 272 |
repo = RepoUrl(repo).repo_id
|
| 273 |
except Exception as e:
|
| 274 |
raise gr.Error(f"Not a valid repo id: {str(repo)}") from e
|
| 275 |
|
|
|
|
|
|
|
|
|
|
| 276 |
edited = {"revision": f"refs/pr/{pr_number}"} if pr_number else {"create_pr": True}
|
| 277 |
|
| 278 |
try:
|
|
|
|
| 264 |
else:
|
| 265 |
token = oauth_token
|
| 266 |
|
|
|
|
|
|
|
|
|
|
| 267 |
if repo.startswith("https://huggingface.co/"):
|
| 268 |
try:
|
| 269 |
repo = RepoUrl(repo).repo_id
|
| 270 |
except Exception as e:
|
| 271 |
raise gr.Error(f"Not a valid repo id: {str(repo)}") from e
|
| 272 |
|
| 273 |
+
with urllib3.PoolManager() as pool:
|
| 274 |
+
results = calculate_results(repo, pool)
|
| 275 |
+
|
| 276 |
edited = {"revision": f"refs/pr/{pr_number}"} if pr_number else {"create_pr": True}
|
| 277 |
|
| 278 |
try:
|