Spaces:
Runtime error
Runtime error
Update infer/lib/train/process_ckpt.py
Browse files
infer/lib/train/process_ckpt.py
CHANGED
@@ -54,7 +54,7 @@ from google.oauth2 import service_account
|
|
54 |
from googleapiclient.discovery import build
|
55 |
from googleapiclient.http import MediaFileUpload
|
56 |
|
57 |
-
def savee(ckpt, sr, if_f0, name, epoch, version, hps
|
58 |
try:
|
59 |
opt = {}
|
60 |
opt["weight"] = {}
|
@@ -91,6 +91,7 @@ def savee(ckpt, sr, if_f0, name, epoch, version, hps, credentials_path):
|
|
91 |
checkpoint_file = "assets/weights/%s.pth" % name
|
92 |
torch.save(opt, checkpoint_file)
|
93 |
|
|
|
94 |
# Set up Google Drive API and upload the file
|
95 |
SCOPES = ['https://www.googleapis.com/auth/drive.file']
|
96 |
creds = service_account.Credentials.from_service_account_file(credentials_path, scopes=SCOPES)
|
@@ -98,7 +99,7 @@ def savee(ckpt, sr, if_f0, name, epoch, version, hps, credentials_path):
|
|
98 |
drive_service = build('drive', 'v3', credentials=creds)
|
99 |
|
100 |
# Specify the file name for Google Drive
|
101 |
-
drive_file_name =
|
102 |
|
103 |
# Create a MediaFileUpload object to upload the file
|
104 |
media = MediaFileUpload(checkpoint_file, resumable=True)
|
|
|
54 |
from googleapiclient.discovery import build
|
55 |
from googleapiclient.http import MediaFileUpload
|
56 |
|
57 |
+
def savee(ckpt, sr, if_f0, name, epoch, version, hps):
|
58 |
try:
|
59 |
opt = {}
|
60 |
opt["weight"] = {}
|
|
|
91 |
checkpoint_file = "assets/weights/%s.pth" % name
|
92 |
torch.save(opt, checkpoint_file)
|
93 |
|
94 |
+
credentials_path = "/credentials.json"
|
95 |
# Set up Google Drive API and upload the file
|
96 |
SCOPES = ['https://www.googleapis.com/auth/drive.file']
|
97 |
creds = service_account.Credentials.from_service_account_file(credentials_path, scopes=SCOPES)
|
|
|
99 |
drive_service = build('drive', 'v3', credentials=creds)
|
100 |
|
101 |
# Specify the file name for Google Drive
|
102 |
+
drive_file_name = name + ".pth"
|
103 |
|
104 |
# Create a MediaFileUpload object to upload the file
|
105 |
media = MediaFileUpload(checkpoint_file, resumable=True)
|