From 517946b9d7d3c346478d0022ce3e109ade81fca7 Mon Sep 17 00:00:00 2001 From: Mangio621 Date: Tue, 2 May 2023 06:47:52 +1000 Subject: [PATCH] Added a new argument --use_gfloat which allows the user to force the use of g_float instead of the default g_half if the user wishes to infer on a normal windows pc. --- config.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index c95feff..fab9130 100644 --- a/config.py +++ b/config.py @@ -4,7 +4,6 @@ import sys import torch from multiprocessing import cpu_count - class Config: def __init__(self): self.device = "cuda:0" @@ -18,7 +17,10 @@ class Config: self.iscolab, self.noparallel, self.noautoopen, + self.use_gfloat, ) = self.arg_parse() + + if self.use_gfloat: self.is_half = False self.x_pad, self.x_query, self.x_center, self.x_max = self.device_config() def arg_parse(self) -> tuple: @@ -36,6 +38,9 @@ class Config: action="store_true", help="Do not open in browser automatically", ) + parser.add_argument( # this argument (if set to false) allows windows users to avoid the "slow_conv2d_cpu not implemented for 'Half'" exception + "--use_gfloat", action="store_true", help="Will use g_float instead of g_half during voice conversion." + ) cmd_opts = parser.parse_args() cmd_opts.port = cmd_opts.port if 0 <= cmd_opts.port <= 65535 else 7865 @@ -46,6 +51,7 @@ class Config: cmd_opts.colab, cmd_opts.noparallel, cmd_opts.noautoopen, + cmd_opts.use_gfloat, ) def device_config(self) -> tuple: