remove cuda-visible-device

This commit is contained in:
Qing 2023-02-07 21:43:37 +08:00
parent 14d9918ef1
commit bb4c44b38d
2 changed files with 0 additions and 15 deletions

View File

@ -47,7 +47,6 @@ def parse_args():
) )
parser.add_argument("--model", default=DEFAULT_MODEL, choices=AVAILABLE_MODELS) 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("--no-half", action="store_true", help=NO_HALF_HELP)
parser.add_argument("--cpu-offload", action="store_true", help=CPU_OFFLOAD_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) parser.add_argument("--disable-nsfw", action="store_true", help=DISABLE_NSFW_HELP)
@ -143,14 +142,6 @@ def parse_args():
parser.error( parser.error(
"torch.cuda.is_available() is False, please use --device cpu or check your pytorch installation" "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.device == "mps":
if args.model not in MPS_SUPPORT_MODELS: if args.model not in MPS_SUPPORT_MODELS:

View File

@ -33,7 +33,6 @@ class Config(BaseModel):
port: int = 8080 port: int = 8080
model: str = DEFAULT_MODEL model: str = DEFAULT_MODEL
device: str = DEFAULT_DEVICE device: str = DEFAULT_DEVICE
cuda_visible_device: str = ""
gui: bool = False gui: bool = False
no_gui_auto_close: bool = False no_gui_auto_close: bool = False
no_half: bool = False no_half: bool = False
@ -60,7 +59,6 @@ def save_config(
port, port,
model, model,
device, device,
cuda_visible_device,
gui, gui,
no_gui_auto_close, no_gui_auto_close,
no_half, no_half,
@ -119,9 +117,6 @@ def main(config_file: str):
device = gr.Radio( device = gr.Radio(
AVAILABLE_DEVICES, label=f"Device(mps supports {MPS_SUPPORT_MODELS})", value=init_config.device 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}") gui = gr.Checkbox(init_config.gui, label=f"{GUI_HELP}")
no_gui_auto_close = gr.Checkbox( no_gui_auto_close = gr.Checkbox(
init_config.no_gui_auto_close, label=f"{NO_GUI_AUTO_CLOSE_HELP}" init_config.no_gui_auto_close, label=f"{NO_GUI_AUTO_CLOSE_HELP}"
@ -154,7 +149,6 @@ def main(config_file: str):
port, port,
model, model,
device, device,
cuda_visible_device,
gui, gui,
no_gui_auto_close, no_gui_auto_close,
no_half, no_half,