Spaces:
Running
on
Zero
Running
on
Zero
Update models/model.py
Browse files- models/model.py +11 -1
models/model.py
CHANGED
|
@@ -79,7 +79,17 @@ def get_username_hf(url):
|
|
| 79 |
if match_username:
|
| 80 |
result = match_username.group(1)
|
| 81 |
return result
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
def download_online_model(url):
|
| 84 |
url = url.strip()
|
| 85 |
if url.startswith('https://download.openxlab.org.cn/models/'):
|
|
|
|
| 79 |
if match_username:
|
| 80 |
result = match_username.group(1)
|
| 81 |
return result
|
| 82 |
+
|
| 83 |
+
pattern_zip = r"/([^/]+)\.zip$"
|
| 84 |
+
|
| 85 |
+
def get_file_name(url):
|
| 86 |
+
match = re.search(pattern_zip, url)
|
| 87 |
+
if match:
|
| 88 |
+
extracted_string = match.group(1)
|
| 89 |
+
return extracted_string
|
| 90 |
+
else:
|
| 91 |
+
raise Exception("没有找到AI歌手模型的zip压缩包。")
|
| 92 |
+
|
| 93 |
def download_online_model(url):
|
| 94 |
url = url.strip()
|
| 95 |
if url.startswith('https://download.openxlab.org.cn/models/'):
|