sparsezoo icon indicating copy to clipboard operation
sparsezoo copied to clipboard

Restore the functionality of setting the env variable "SPARSEZOO_MODELS_PATH"

Open dbogunowicz opened this issue 2 years ago • 0 comments

Testing:

with the variable set

SPARSEZOO_MODELS_PATH=/home/damian/all_your_base_are_belong_to_us
import sparsezoo
import os

stub = "zoo:cv/classification/mobilenet_v1-1.0/pytorch/sparseml/imagenet/pruned_quant-moderate"
model = sparsezoo.Model(stub)
print(os.getenv("SPARSEZOO_MODELS_PATH", ""))
print(model._path)
>> /home/damian/all_your_base_are_belong_to_us
>> home/damian/all_your_base_are_belong_to_us/4ce8e2fe-29a1-4027-bead-408d28702643

with no variable set

SPARSEZOO_MODELS_PATH=/home/damian/all_your_base_are_belong_to_us
import sparsezoo
import os

stub = "zoo:cv/classification/mobilenet_v1-1.0/pytorch/sparseml/imagenet/pruned_quant-moderate"
model = sparsezoo.Model(stub)
print(os.getenv("SPARSEZOO_MODELS_PATH", ""))
print(model._path)

/home/damian/.cache/sparsezoo/4ce8e2fe-29a1-4027-bead-408d28702643

dbogunowicz avatar Aug 09 '22 10:08 dbogunowicz