Spaces:
Sleeping
Sleeping
Efreak
commited on
fix repo_url
Browse files
app.py
CHANGED
|
@@ -46,7 +46,13 @@ def duplicate(source_url, dst_repo, token, new_name, dst_repo_path, repo_type):
|
|
| 46 |
# now clean up
|
| 47 |
os.remove(dir+files[0])
|
| 48 |
os.rmdir(dir)
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
return (
|
| 51 |
f'Find your repo <a href=\'{repo_url}\' target="_blank" style="text-decoration:underline">here</a>',
|
| 52 |
"sp.jpg",
|
|
@@ -66,7 +72,7 @@ def duplicate(source_url, dst_repo, token, new_name, dst_repo_path, repo_type):
|
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
-
""" + excuse
|
| 70 |
None,
|
| 71 |
)
|
| 72 |
|
|
|
|
| 46 |
# now clean up
|
| 47 |
os.remove(dir+files[0])
|
| 48 |
os.rmdir(dir)
|
| 49 |
+
match repo_type:
|
| 50 |
+
case "space":
|
| 51 |
+
repo_url=f"https://hf.co/spaces/{dst_repo}"
|
| 52 |
+
case "dataset":
|
| 53 |
+
repo_url=f"https://hf.co/datasets/{dst_repo}"
|
| 54 |
+
case "model":
|
| 55 |
+
repo_url=f"https://hf.co/{dst_repo}"
|
| 56 |
return (
|
| 57 |
f'Find your repo <a href=\'{repo_url}\' target="_blank" style="text-decoration:underline">here</a>',
|
| 58 |
"sp.jpg",
|
|
|
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
+
<i>""" + excuse+"</i>,
|
| 76 |
None,
|
| 77 |
)
|
| 78 |
|