-
Notifications
You must be signed in to change notification settings - Fork 1
/
IPYNB.bat
67 lines (52 loc) · 1.46 KB
/
IPYNB.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@echo off
setlocal
:: Check if venv_sdh exists
if not exist venv_sdh (
echo %time% Creating venv...
python -m venv venv_sdh
)
:: Deactive venv
call venv_sdh\Scripts\deactivate.bat
:: Activate venv
echo %time% Activating venv...
call venv_sdh\Scripts\activate
echo %time% Updating Repository
git add *
git stash
git pull > nul 2>&1
echo %time% Updating/Checking
for /l %%i in (1,1,10) do (
<nul set /p "=."
ping localhost -n 2 > nul
)
:: Update requirements
echo %time% Updating requirements...
pip install -r requirements.txt > nul 2>&1
echo Do you want to re-install remBG with GPU support ? Only do this if you want GPU support and/or have CPU issues when running remBG ( 1 for yes, 0 for no):
set /p remRedo=
if "%remRedo%"=="1" (
echo Updating RemBG with GPU support...
echo y | pip uninstall rembg
echo y | pip uninstall onnxruntime
pip install rembg[gpu] onnxruntime-gpu
) else if "%remRedo%"=="0" (
echo.
) else (
echo Invalid choice.
)
for /l %%i in (1,1,10) do (
<nul set /p "=."
ping localhost -n 2 > nul
)
echo.
:: Launch _Helper.ipynb with a specific kernel (e.g., "python3")
echo %time% Launching .ipynb...
echo .ipynb launched at http://localhost:8888/notebooks/_Helper.ipynb
call jupyter notebook _Helper.ipynb --NotebookApp.kernel_name=python3 > nul 2>&1
:: Deactivate venv
echo %time% Deactivating venv...
deactivate
echo %time% Loading complete.
:: Pause to keep the window open
echo %time% Pausing execution...
pause