remove cuda-visible-device
This commit is contained in:
parent
14d9918ef1
commit
bb4c44b38d
@ -47,7 +47,6 @@ def parse_args():
|
||||
)
|
||||
|
||||
parser.add_argument("--model", default=DEFAULT_MODEL, choices=AVAILABLE_MODELS)
|
||||
parser.add_argument("--cuda-visible-device", default="")
|
||||
parser.add_argument("--no-half", action="store_true", help=NO_HALF_HELP)
|
||||
parser.add_argument("--cpu-offload", action="store_true", help=CPU_OFFLOAD_HELP)
|
||||
parser.add_argument("--disable-nsfw", action="store_true", help=DISABLE_NSFW_HELP)
|
||||
@ -143,14 +142,6 @@ def parse_args():
|
||||
parser.error(
|
||||
"torch.cuda.is_available() is False, please use --device cpu or check your pytorch installation"
|
||||
)
|
||||
if args.cuda_visible_device:
|
||||
try:
|
||||
int(args.cuda_visible_device)
|
||||
except:
|
||||
parser.error(
|
||||
f"invalid --cuda-visible-device: {args.cuda_visible_device}, must be int"
|
||||
)
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = args.cuda_visible_device
|
||||
|
||||
if args.device == "mps":
|
||||
if args.model not in MPS_SUPPORT_MODELS:
|
||||
|
@ -33,7 +33,6 @@ class Config(BaseModel):
|
||||
port: int = 8080
|
||||
model: str = DEFAULT_MODEL
|
||||
device: str = DEFAULT_DEVICE
|
||||
cuda_visible_device: str = ""
|
||||
gui: bool = False
|
||||
no_gui_auto_close: bool = False
|
||||
no_half: bool = False
|
||||
@ -60,7 +59,6 @@ def save_config(
|
||||
port,
|
||||
model,
|
||||
device,
|
||||
cuda_visible_device,
|
||||
gui,
|
||||
no_gui_auto_close,
|
||||
no_half,
|
||||
@ -119,9 +117,6 @@ def main(config_file: str):
|
||||
device = gr.Radio(
|
||||
AVAILABLE_DEVICES, label=f"Device(mps supports {MPS_SUPPORT_MODELS})", value=init_config.device
|
||||
)
|
||||
cuda_visible_device = gr.Textbox(
|
||||
"", label="CUDA visible device. (0/1/2...)"
|
||||
)
|
||||
gui = gr.Checkbox(init_config.gui, label=f"{GUI_HELP}")
|
||||
no_gui_auto_close = gr.Checkbox(
|
||||
init_config.no_gui_auto_close, label=f"{NO_GUI_AUTO_CLOSE_HELP}"
|
||||
@ -154,7 +149,6 @@ def main(config_file: str):
|
||||
port,
|
||||
model,
|
||||
device,
|
||||
cuda_visible_device,
|
||||
gui,
|
||||
no_gui_auto_close,
|
||||
no_half,
|
||||
|
Loading…
Reference in New Issue
Block a user