Spaces:
Runtime error
Runtime error
Update flask_api_full_song.py
Browse files- flask_api_full_song.py +6 -12
flask_api_full_song.py
CHANGED
|
@@ -20,24 +20,18 @@ bucket_name = 'xiaohei-cat-ai-1304646510'
|
|
| 20 |
config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key)
|
| 21 |
client = CosS3Client(config)
|
| 22 |
|
| 23 |
-
response1 = client.
|
| 24 |
Bucket=bucket_name,
|
| 25 |
-
Key="models/So-VITS-SVC/Koxia-Full/G_full.pth"
|
|
|
|
| 26 |
)
|
| 27 |
|
| 28 |
-
|
| 29 |
-
for chunk in response1['Body'].iter_content(chunk_size=1024):
|
| 30 |
-
local_file.write(chunk)
|
| 31 |
-
|
| 32 |
-
response2 = client.get_object(
|
| 33 |
Bucket=bucket_name,
|
| 34 |
-
Key="models/So-VITS-SVC/Koxia-Full/config.json"
|
|
|
|
| 35 |
)
|
| 36 |
|
| 37 |
-
with open("/tmp/config.json", 'wb') as local_file:
|
| 38 |
-
for chunk in response2['Body'].iter_content(chunk_size=1024):
|
| 39 |
-
local_file.write(chunk)
|
| 40 |
-
|
| 41 |
model_name = "/tmp/G_full.pth" # 模型地址
|
| 42 |
config_name = "/tmp/config.json" # config地址
|
| 43 |
svc_model = infer_tool.Svc(model_name, config_name)
|
|
|
|
| 20 |
config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key)
|
| 21 |
client = CosS3Client(config)
|
| 22 |
|
| 23 |
+
response1 = client.download_file(
|
| 24 |
Bucket=bucket_name,
|
| 25 |
+
Key="models/So-VITS-SVC/Koxia-Full/G_full.pth",
|
| 26 |
+
DestFilePath="/tmp/G_full.pth"
|
| 27 |
)
|
| 28 |
|
| 29 |
+
response2 = client.download_file(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
Bucket=bucket_name,
|
| 31 |
+
Key="models/So-VITS-SVC/Koxia-Full/config.json",
|
| 32 |
+
DestFilePath="/tmp/config.json"
|
| 33 |
)
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
model_name = "/tmp/G_full.pth" # 模型地址
|
| 36 |
config_name = "/tmp/config.json" # config地址
|
| 37 |
svc_model = infer_tool.Svc(model_name, config_name)
|