Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kokoro/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ def __init__(
if not model:
try:
model = hf_hub_download(repo_id=repo_id, filename=KModel.MODEL_NAMES[repo_id])
except:
except Exception:
model = os.path.join(repo_id, 'kokoro-v1_0.pth')
for key, state_dict in torch.load(model, map_location='cpu', weights_only=True).items():
assert hasattr(self, key), key
try:
getattr(self, key).load_state_dict(state_dict)
except:
except Exception:
logger.debug(f"Did not load {key} from state_dict")
state_dict = {k[7:]: v for k, v in state_dict.items()}
getattr(self, key).load_state_dict(state_dict, strict=False)
Expand Down
2 changes: 1 addition & 1 deletion wan/modules/multitalk_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from sageattention import sageattn
USE_SAGEATTN = True
logging.info("Using sageattn")
except:
except Exception:
USE_SAGEATTN = False

__all__ = ['WanModel']
Expand Down
2 changes: 1 addition & 1 deletion wan/utils/prompt_extend.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def __init__(self, model_name=None, device=0, is_vl=False, **kwargs):
)
try:
from .qwen_vl_utils import process_vision_info
except:
except Exception:
from qwen_vl_utils import process_vision_info
self.process_vision_info = process_vision_info
min_pixels = 256 * 28 * 28
Expand Down