Skip to content

Commit

Permalink
Update unix based system requirements file
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais committed Jun 7, 2023
1 parent b3081b5 commit 797e2b4
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ RUN python3 -m pip install wheel
## RUN python3 -m pip install -v -U git+https://github.com/facebookresearch/xformers.git@main#egg=xformers

# Install requirements
COPY requirements.txt setup.py ./
RUN python3 -m pip install --use-pep517 -r requirements.txt xformers
COPY requirements_unix.txt setup.py ./
RUN python3 -m pip install --use-pep517 -r requirements_unix.txt xformers

# Replace pillow with pillow-simd
RUN python3 -m pip uninstall -y pillow && \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ This will store a backup file with your current locally installed pip packages a
- Small UI improvements
- Fix `train_network.py` to probably work with older versions of LyCORIS.
- `gen_img_diffusers.py` now supports `BREAK` syntax.
- Add Lycoris iA3, LoKr and DyLoRA support to the UI
- Upgrade LuCORIS python module to 0.1.6
* 2023/06/05 (v21 7.5)
- Fix reported issue with LoHA: https://github.com/bmaltais/kohya_ss/issues/922
* 2023/06/05 (v21.7.4)
Expand Down
2 changes: 1 addition & 1 deletion gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ cd "$SCRIPT_DIR"
source "$SCRIPT_DIR/venv/bin/activate"

# If the requirements are validated, run the kohya_gui.py script with the command-line arguments
if python "$SCRIPT_DIR"/tools/validate_requirements.py -r "$SCRIPT_DIR"/requirements.txt; then
if python "$SCRIPT_DIR"/tools/validate_requirements.py -r "$SCRIPT_DIR"/requirements_unix.txt; then
python "$SCRIPT_DIR/kohya_gui.py" "$@"
fi
File renamed without changes.
10 changes: 5 additions & 5 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This file will be the host environment setup file for all operating systems other than base Windows.

# Set the required package versions here.
# They will be appended to the requirements.txt file in the installation directory.
# They will be appended to the requirements_unix.txt file in the installation directory.
TENSORFLOW_VERSION="2.12.0"
TENSORFLOW_MACOS_VERSION="2.12.0"
TENSORFLOW_METAL_VERSION="0.8.0"
Expand Down Expand Up @@ -262,14 +262,14 @@ install_python_dependencies() {
# DEBUG ONLY (Update this version number to whatever PyCharm recommends)
# pip install pydevd-pycharm~=223.8836.43

#This will copy our requirements.txt file out and make the khoya_ss lib a dynamic location then cleanup.
#This will copy our requirements_unix.txt file out and make the khoya_ss lib a dynamic location then cleanup.
local TEMP_REQUIREMENTS_FILE="$DIR/requirements_tmp_for_setup.txt"
echo "Copying $DIR/requirements.txt to $TEMP_REQUIREMENTS_FILE" >&3
echo "Copying $DIR/requirements_unix.txt to $TEMP_REQUIREMENTS_FILE" >&3
echo "Replacing the . for lib to our DIR variable in $TEMP_REQUIREMENTS_FILE." >&3
awk -v dir="$DIR" '/#.*kohya_ss.*library/{print; getline; sub(/^\.$/, dir)}1' "$DIR/requirements.txt" >"$TEMP_REQUIREMENTS_FILE"
awk -v dir="$DIR" '/#.*kohya_ss.*library/{print; getline; sub(/^\.$/, dir)}1' "$DIR/requirements_unix.txt" >"$TEMP_REQUIREMENTS_FILE"

# This will check if macOS is running then determine if M1+ or Intel CPU.
# It will append the appropriate packages to the requirements.txt file.
# It will append the appropriate packages to the requirements_unix.txt file.
# Other OSs won't be affected and the version variables are at the top of this file.
if [[ "$(uname)" == "Darwin" ]]; then
# Check if the processor is Apple Silicon (arm64)
Expand Down
1 change: 0 additions & 1 deletion tools/validate_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def main():
'-r',
'--requirements',
type=str,
default='requirements.txt',
help='Path to the requirements file.',
)
parser.add_argument('--debug', action='store_true', help='Debug on')
Expand Down
2 changes: 1 addition & 1 deletion upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ git pull
source venv/bin/activate

# Upgrade the required packages
pip install --use-pep517 --upgrade -r requirements.txt
pip install --use-pep517 --upgrade -r requirements_unix.txt

0 comments on commit 797e2b4

Please sign in to comment.