Skip to content

Commit

Permalink
Merge pull request #290 from centre-for-humanities-computing/fix--All…
Browse files Browse the repository at this point in the history
…ow-for-newest-version-of-pip

fix: Allow for newest version of pip
  • Loading branch information
KennethEnevoldsen authored Oct 30, 2024
2 parents d990deb + 0d088b6 commit ea0a07d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/dacy/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ def download_url(url: str, output_path: str) -> None:
urllib.request.urlretrieve(url, filename=output_path, reporthook=t.update_to)


def install(package): # noqa
def install(package: str, url: str) -> None:
import subprocess
import sys

subprocess.check_call(
[sys.executable, "-m", "pip", "install", package, "--no-deps"],
[sys.executable, "-m", "pip", "install", f"{package} @ {url}", "--no-deps"],
)


Expand Down Expand Up @@ -115,5 +115,7 @@ def download_model(
mdl = model.split("-")[0] # type: ignore
if mdl in get_installed_models() and not force and version(mdl) == mdl_version:
return mdl
install(models_url[model])

package = model.split("-")[0]
install(package, models_url[model])
return mdl

0 comments on commit ea0a07d

Please sign in to comment.