Spaces:
Build error
Build error
Update config.py
Browse files
config.py
CHANGED
|
@@ -15,54 +15,55 @@ def use_fp32_config():
|
|
| 15 |
device = torch.device("cuda:0") # Assuming you have only one GPU (index 0).
|
| 16 |
device_capability = torch.cuda.get_device_capability(device)[0]
|
| 17 |
if device_capability >= 7:
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
|
| 29 |
-
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
else:
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
|
| 53 |
-
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
|
| 60 |
-
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
|
|
| 66 |
else:
|
| 67 |
print(
|
| 68 |
"CUDA is not available. Make sure you have an NVIDIA GPU and CUDA installed."
|
|
|
|
| 15 |
device = torch.device("cuda:0") # Assuming you have only one GPU (index 0).
|
| 16 |
device_capability = torch.cuda.get_device_capability(device)[0]
|
| 17 |
if device_capability >= 7:
|
| 18 |
+
# usefp16 = True
|
| 19 |
+
# for config_file in ["32k.json", "40k.json", "48k.json"]:
|
| 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 |
+
pass
|
| 67 |
else:
|
| 68 |
print(
|
| 69 |
"CUDA is not available. Make sure you have an NVIDIA GPU and CUDA installed."
|