Skip to content

Commit

Permalink
Merge pull request #273 from Haidra-Org/windows_mamba_root_prefix
Browse files Browse the repository at this point in the history
fix: further bug fixes to install process
  • Loading branch information
tazlin authored Jul 1, 2023
2 parents 61ad429 + cf5b17c commit 4d0d162
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
1 change: 0 additions & 1 deletion horde-alchemist-bridge.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@echo off
cd /d %~dp0
call runtime python -s bridge_alchemy.py %*
%0 %*
4 changes: 0 additions & 4 deletions horde-bridge.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@echo off
cd /d %~dp0
call runtime python -s bridge_stable_diffusion.py %*
IF %ERRORLEVEL% EQU 0 (
EXIT /B
)
%0 %*
4 changes: 0 additions & 4 deletions horde-scribe-bridge.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@echo off
cd /d %~dp0
call runtime python -s bridge_scribe.py %*
IF %ERRORLEVEL% EQU 0 (
EXIT /B
)
%0 %*
3 changes: 2 additions & 1 deletion runtime.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ call update-runtime
call %MAMBA_ROOT_PREFIX%\condabin\micromamba.bat activate windows

%*
IF [%1] == [] TITLE Runtime Command Prompt && cmd /k
call micromamba deactivate

19 changes: 14 additions & 5 deletions update-runtime.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ cd /d "%~dp0"
SET CONDA_SHLVL=
SET PYTHONNOUSERSITE=1
SET PYTHONPATH=
SET MAMBA_ROOT_PREFIX=%~dp0conda
echo %MAMBA_ROOT_PREFIX%


setlocal EnableDelayedExpansion
for %%a in (%*) do (
Expand Down Expand Up @@ -36,16 +39,22 @@ umamba create --no-shortcuts -r conda -n windows -f %CONDA_ENVIRONMENT_FILE% -y
umamba create --no-shortcuts -r conda -n windows -f %CONDA_ENVIRONMENT_FILE% -y

REM Check if hordelib argument is defined

umamba.exe shell hook -s cmd.exe -p %MAMBA_ROOT_PREFIX% -v
call %MAMBA_ROOT_PREFIX%\condabin\mamba_hook.bat
call %MAMBA_ROOT_PREFIX%\condabin\micromamba.bat activate windows

if defined hordelib (
umamba run -r conda -n windows python -s -m pip uninstall -y hordelib horde_model_reference
umamba run -r conda -n windows python -s -m pip install hordelib horde_model_reference
python -s -m pip uninstall -y hordelib horde_model_reference
python -s -m pip install hordelib horde_model_reference
) else (
if defined scribe (
umamba run -r conda -n windows python -s -m pip install -r requirements-scribe.txt
python -s -m pip install -r requirements-scribe.txt
) else (
umamba run -r conda -n windows python -s -m pip uninstall nataili
umamba run -r conda -n windows python -s -m pip install -r requirements.txt
python -s -m pip uninstall nataili
python -s -m pip install -r requirements.txt
)
)
call micromamba deactivate

echo If there are no errors above everything should be correctly installed (If not, try deleting the folder /conda/envs/ and try again).

0 comments on commit 4d0d162

Please sign in to comment.