Added Dockerfile

This commit is contained in:
Loreto Parisi
2021-11-15 20:11:46 +01:00
parent 4e027f81e6
commit e839a36503
4 changed files with 57 additions and 2 deletions

View File

@@ -17,8 +17,9 @@ def download_model(url=LAMA_MODEL_URL):
parts = urlparse(url)
hub_dir = get_dir()
model_dir = os.path.join(hub_dir, "checkpoints")
if not os.path.isdir(model_dir):
os.makedirs(os.path.join(model_dir, "hub", "checkpoints"))
filename = os.path.basename(parts.path)
cached_file = os.path.join(model_dir, filename)
if not os.path.exists(cached_file):
sys.stderr.write('Downloading: "{}" to {}\n'.format(url, cached_file))