From 9f6e0c1c8f6af6854987a5caa94bb4eb00b3817f Mon Sep 17 00:00:00 2001 From: bmaltais Date: Thu, 30 Mar 2023 07:23:37 -0400 Subject: [PATCH] Fix issue with LyCORIS version --- README.md | 2 ++ requirements.txt | 3 ++- tools/validate_requirements.py | 14 +++++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 15030b7..c6e89c7 100644 --- a/README.md +++ b/README.md @@ -213,6 +213,8 @@ This will store your a backup file with your current locally installed pip packa ## Change History +* 2023/03/30 (v21.3.8) + - Fix issue with LyCORIS version not being found: https://github.com/bmaltais/kohya_ss/issues/481 * 2023/03/29 (v21.3.7) - Allow for 0.1 increment in Network and Conv alpha values: https://github.com/bmaltais/kohya_ss/pull/471 Thanks to @srndpty - Updated Lycoris module version diff --git a/requirements.txt b/requirements.txt index f8a1e88..5881d6e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,6 +25,7 @@ timm==0.6.12 huggingface-hub==0.13.0 tensorflow==2.10.1 # For locon support -lycoris_lora==0.1.4 +lycoris-lora @ git+https://github.com/KohakuBlueleaf/LyCORIS.git@c3d925421209a22a60d863ffa3de0b3e7e89f047 +# lycoris_lora==0.1.4 # for kohya_ss library . \ No newline at end of file diff --git a/tools/validate_requirements.py b/tools/validate_requirements.py index 948c21f..86f09d5 100644 --- a/tools/validate_requirements.py +++ b/tools/validate_requirements.py @@ -25,7 +25,19 @@ for requirement in requirements: try: pkg_resources.require(requirement) except pkg_resources.DistributionNotFound: - missing_requirements.append(requirement) + # Check if the requirement contains a VCS URL + if "@" in requirement: + # If it does, split the requirement into two parts: the package name and the VCS URL + package_name, vcs_url = requirement.split("@", 1) + # Use pip to install the package from the VCS URL + os.system(f"pip install -e {vcs_url}") + # Try to require the package again + try: + pkg_resources.require(package_name) + except pkg_resources.DistributionNotFound: + missing_requirements.append(requirement) + else: + missing_requirements.append(requirement) except pkg_resources.VersionConflict as e: wrong_version_requirements.append((requirement, str(e.req), e.dist.version))