Open thogerb opened 3 years ago
Ok, I notice now that the same could probably also be achieved by globally calling torch.hub.set_dir
or setting the TORCH_HOME
environment variable.
Docs: https://pytorch.org/docs/stable/hub.html#torch.hub.get_dir
Personally not a big fan of using the global state but it should suffice for the use case 👍 Feel free to close this opened "Issue".
Hi @1adrianb
Lovely package, first of all. I was testing it, and ran into (and have resolved in a fork) an issue with deploying to AWS Lambda:
get_dir
from torch.hub which is not within that namespaceFix/enhancement (easy): Add
model_dir: str = None
to each of the__init__
for classes that use torch URL-loading functions. Downstream functions already support the explicit model_dir, but top-level class initialization e.g. inapi.py
module doesn't.If you agree, I am happy to send you a PR on it:)
Best, Thoger.