Skip to content

Commit

Permalink
fix(webui): disable torch.compile on Windows (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
aliencaocao authored Jun 24, 2024
1 parent 21a216f commit 109376c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/web/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
4 changes: 2 additions & 2 deletions examples/web/webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ def make_audio(autoplay, stream):
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.")
Expand Down

0 comments on commit 109376c

Please sign in to comment.