Spaces:
Runtime error
Runtime error
Update infer/lib/train/process_ckpt.py
Browse files
infer/lib/train/process_ckpt.py
CHANGED
@@ -9,9 +9,6 @@ from i18n.i18n import I18nAuto
|
|
9 |
|
10 |
i18n = I18nAuto()
|
11 |
|
12 |
-
import os
|
13 |
-
from pydrive.auth import GoogleAuth
|
14 |
-
from pydrive.drive import GoogleDrive
|
15 |
|
16 |
def savee(ckpt, sr, if_f0, name, epoch, version, hps):
|
17 |
try:
|
@@ -47,20 +44,7 @@ def savee(ckpt, sr, if_f0, name, epoch, version, hps):
|
|
47 |
opt["f0"] = if_f0
|
48 |
opt["version"] = version
|
49 |
torch.save(opt, "assets/weights/%s.pth" % name)
|
50 |
-
|
51 |
-
local_file_path = "assets/weights/%s.pth" % name
|
52 |
-
torch.save(opt, local_file_path)
|
53 |
-
|
54 |
-
# Authenticate with Google Drive
|
55 |
-
gauth = GoogleAuth()
|
56 |
-
gauth.LocalWebserverAuth() # This will open a web page for authentication
|
57 |
-
drive = GoogleDrive(gauth)
|
58 |
-
|
59 |
-
# Create a Google Drive file and upload it
|
60 |
-
file_drive = drive.CreateFile({'title': name})
|
61 |
-
file_drive.Upload()
|
62 |
|
63 |
-
return "Success: File uploaded to Google Drive."
|
64 |
return "Success."
|
65 |
except:
|
66 |
return traceback.format_exc()
|
|
|
9 |
|
10 |
i18n = I18nAuto()
|
11 |
|
|
|
|
|
|
|
12 |
|
13 |
def savee(ckpt, sr, if_f0, name, epoch, version, hps):
|
14 |
try:
|
|
|
44 |
opt["f0"] = if_f0
|
45 |
opt["version"] = version
|
46 |
torch.save(opt, "assets/weights/%s.pth" % name)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
|
|
48 |
return "Success."
|
49 |
except:
|
50 |
return traceback.format_exc()
|