Skip to content

Instantly share code, notes, and snippets.

@ahmedbesbes
Created October 2, 2022 20:19
Show Gist options
  • Save ahmedbesbes/1f438f000f6b7dfceb6a2eb14ccf4309 to your computer and use it in GitHub Desktop.
Save ahmedbesbes/1f438f000f6b7dfceb6a2eb14ccf4309 to your computer and use it in GitHub Desktop.
def load_model(filename: str, cache_folder: Union[str, Path]):
if isinstance(cache_folder, Path):
cache_folder = str(cache_folder)
model_path = os.join(filename, cache_folder)
model = torch.load(model_path)
return model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment