fix(webui): disable torch.compile on Windows (#413)

This commit is contained in:
Billy Cao
2024-06-24 14:08:33 +08:00
committed by GitHub
parent 21a216f6d2
commit 109376c326
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -45,10 +45,10 @@ def reload_chat(coef: Optional[str]) -> str:
gr.Warning("Ingore invalid DVAE coefficient.")
coef = None
if custom_path == None:
ret = chat.load_models(coef=coef)
ret = chat.load_models(coef=coef, compile=sys.platform != 'win32')
else:
logger.info('local model path: %s', custom_path)
ret = chat.load_models('custom', custom_path=custom_path, coef=coef)
ret = chat.load_models('custom', custom_path=custom_path, coef=coef, compile=sys.platform != 'win32')
if not ret:
raise gr.Error("Unable to load model.")
gr.Info("Reload succeess.")
+2 -2
View File
@@ -104,10 +104,10 @@ def main():
global chat, custom_path
if args.custom_path == None:
ret = chat.load_models()
ret = chat.load_models(compile=sys.platform != 'win32')
else:
logger.info('local model path: %s', args.custom_path)
ret = chat.load_models('custom', custom_path=args.custom_path)
ret = chat.load_models('custom', custom_path=args.custom_path, compile=sys.platform != 'win32')
if ret:
logger.info("Models loaded successfully.")