Skip to content

Commit

Permalink
fix(toolkit): usage on windows (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
badayvedat authored Jan 24, 2024
1 parent b5cae79 commit 89c69a5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions projects/fal/src/fal/toolkit/utils/download_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import shutil
import subprocess
from functools import lru_cache
from pathlib import Path
from pathlib import Path, PurePath
from tempfile import TemporaryDirectory
from urllib.parse import urlparse
from urllib.request import Request, urlopen

from fal.toolkit.mainify import mainify

FAL_PERSISTENT_DIR = Path("/data")
FAL_PERSISTENT_DIR = PurePath("/data")
FAL_REPOSITORY_DIR = FAL_PERSISTENT_DIR / ".fal" / "repos"
FAL_MODEL_WEIGHTS_DIR = FAL_PERSISTENT_DIR / ".fal" / "model_weights"

Expand Down Expand Up @@ -148,7 +148,7 @@ def download_file(

# If target_dir is not an absolute path, use "/data" as the relative directory
if not target_dir_path.is_absolute():
target_dir_path = FAL_PERSISTENT_DIR / target_dir_path
target_dir_path = FAL_PERSISTENT_DIR / target_dir_path # type: ignore[assignment]

target_path = target_dir_path.resolve() / file_name

Expand Down Expand Up @@ -338,10 +338,10 @@ def clone_repository(
Returns:
A Path object representing the full path to the cloned Git repository.
"""
target_dir = target_dir or FAL_REPOSITORY_DIR
target_dir = target_dir or FAL_REPOSITORY_DIR # type: ignore[assignment]
repo_name = repo_name or Path(https_url).stem

local_repo_path = Path(target_dir) / repo_name
local_repo_path = Path(target_dir) / repo_name # type: ignore[arg-type]

if local_repo_path.exists():
local_repo_commit_hash = _get_git_revision_hash(local_repo_path)
Expand Down

0 comments on commit 89c69a5

Please sign in to comment.