_Noxty
commited on
Update config.py
Browse files
config.py
CHANGED
@@ -16,56 +16,10 @@ def use_fp32_config():
|
|
16 |
device_capability = torch.cuda.get_device_capability(device)[0]
|
17 |
if device_capability >= 7:
|
18 |
usefp16 = True
|
19 |
-
|
20 |
-
with open(f"configs/{config_file}", "r") as d:
|
21 |
-
data = json.load(d)
|
22 |
-
|
23 |
-
if "train" in data and "fp16_run" in data["train"]:
|
24 |
-
data["train"]["fp16_run"] = True
|
25 |
-
|
26 |
-
with open(f"configs/{config_file}", "w") as d:
|
27 |
-
json.dump(data, d, indent=4)
|
28 |
-
|
29 |
-
print(f"Set fp16_run to true in {config_file}")
|
30 |
-
|
31 |
-
with open(
|
32 |
-
"trainset_preprocess_pipeline_print.py", "r", encoding="utf-8"
|
33 |
-
) as f:
|
34 |
-
strr = f.read()
|
35 |
-
|
36 |
-
strr = strr.replace("3.0", "3.7")
|
37 |
-
|
38 |
-
with open(
|
39 |
-
"trainset_preprocess_pipeline_print.py", "w", encoding="utf-8"
|
40 |
-
) as f:
|
41 |
-
f.write(strr)
|
42 |
-
else:
|
43 |
-
for config_file in ["32k.json", "40k.json", "48k.json"]:
|
44 |
-
with open(f"configs/{config_file}", "r") as f:
|
45 |
-
data = json.load(f)
|
46 |
-
|
47 |
-
if "train" in data and "fp16_run" in data["train"]:
|
48 |
-
data["train"]["fp16_run"] = False
|
49 |
-
|
50 |
-
with open(f"configs/{config_file}", "w") as d:
|
51 |
-
json.dump(data, d, indent=4)
|
52 |
-
|
53 |
-
print(f"Set fp16_run to false in {config_file}")
|
54 |
-
|
55 |
-
with open(
|
56 |
-
"trainset_preprocess_pipeline_print.py", "r", encoding="utf-8"
|
57 |
-
) as f:
|
58 |
-
strr = f.read()
|
59 |
-
|
60 |
-
strr = strr.replace("3.7", "3.0")
|
61 |
-
|
62 |
-
with open(
|
63 |
-
"trainset_preprocess_pipeline_print.py", "w", encoding="utf-8"
|
64 |
-
) as f:
|
65 |
-
f.write(strr)
|
66 |
else:
|
67 |
print(
|
68 |
-
"CUDA is not available
|
69 |
)
|
70 |
return (usefp16, device_capability)
|
71 |
|
|
|
16 |
device_capability = torch.cuda.get_device_capability(device)[0]
|
17 |
if device_capability >= 7:
|
18 |
usefp16 = True
|
19 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
else:
|
21 |
print(
|
22 |
+
"CUDA is not available: Make sure you have an NVIDIA GPU and CUDA installed."
|
23 |
)
|
24 |
return (usefp16, device_capability)
|
25 |
|