Skip to content

Commit

Permalink
fix downloading of models in the python binding
Browse files Browse the repository at this point in the history
models come in files named like `csen.student.base.v1.cd5418ba6a412fc7.tar.gz`, but the directory they create when extracted are named like `csen.student.base`. we therefore need to remove not just the extension but everything following and including the 3rd period
  • Loading branch information
bjesus authored Apr 19, 2024
1 parent 5261614 commit e5d73db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bindings/python/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def safe_extract(tar, path=".", members=None, *, numeric_owner=False):
def _archive_name_without_extension(self, url: URL):
o = urlparse(url)
fname = os.path.basename(o.path) # something tar.gz.
fname_without_extension = fname.replace(".tar.gz", "")
fname_without_extension = ".".join(fname.split(".")[:3])
return fname_without_extension


Expand Down

0 comments on commit e5d73db

Please sign in to comment.