diff --git a/laser_encoders/download_models.py b/laser_encoders/download_models.py index fbd731db..08b91761 100644 --- a/laser_encoders/download_models.py +++ b/laser_encoders/download_models.py @@ -45,7 +45,10 @@ def __init__(self, model_dir: str = None): self.base_url = "https://dl.fbaipublicfiles.com/nllb/laser" def download(self, filename: str): - url = os.path.join(self.base_url, filename) + # Because on windows os.path.join will use "\" insted of "/", so link would be: + # https://dl.fbaipublicfiles.com/nllb/laser\laser2.pt instead of https://dl.fbaipublicfiles.com/nllb/laser/laser2.pt + # which results in a failed download. + url = f"{self.base_url}/{filename}" local_file_path = os.path.join(self.model_dir, filename) if os.path.exists(local_file_path):