mirror of
https://github.com/openai/whisper.git
synced 2025-11-24 14:35:57 +00:00
Update __init__.py
This commit is contained in:
parent
8c3f996e1e
commit
915b3e747b
@ -147,7 +147,10 @@ def load_model(
|
||||
with (
|
||||
io.BytesIO(checkpoint_file) if in_memory else open(checkpoint_file, "rb")
|
||||
) as fp:
|
||||
checkpoint = torch.load(fp, map_location=device, weights_only=True)
|
||||
try:
|
||||
checkpoint = torch.load(fp, map_location=device, weights_only=True)
|
||||
except TypeError: # for compatibility with older torch
|
||||
checkpoint = torch.load(fp, map_location=device)
|
||||
del checkpoint_file
|
||||
|
||||
dims = ModelDimensions(**checkpoint["dims"])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user