-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
140 lines (125 loc) · 3.61 KB
/
setup.bat
File metadata and controls
140 lines (125 loc) · 3.61 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
@echo off
setlocal enabledelayedexpansion
echo ============================================
echo Lore Compendium - Easy Setup Script
echo ============================================
echo.
REM Check if Python is installed
echo [1/6] Checking for Python installation...
python --version >nul 2>&1
if errorlevel 1 (
echo [ERROR] Python is not installed or not in PATH!
echo.
echo Please install Python 3.13 from: https://www.python.org/downloads/
echo Make sure to check "Add Python to PATH" during installation!
echo.
pause
exit /b 1
)
echo [OK] Python is installed.
python --version
echo.
REM Check if Ollama is installed
echo [2/6] Checking for Ollama installation...
ollama --version >nul 2>&1
if errorlevel 1 (
echo [ERROR] Ollama is not installed or not in PATH!
echo.
echo Please install Ollama from: https://ollama.com/download/windows
echo After installation, restart your computer and run this setup again.
echo.
pause
exit /b 1
)
echo [OK] Ollama is installed.
ollama --version
echo.
REM Create virtual environment if it doesn't exist
echo [3/6] Setting up Python virtual environment...
if not exist ".venv" (
echo Creating new virtual environment...
python -m venv .venv
if errorlevel 1 (
echo [ERROR] Failed to create virtual environment!
pause
exit /b 1
)
echo [OK] Virtual environment created.
) else (
echo [OK] Virtual environment already exists.
)
echo.
REM Activate virtual environment and install dependencies
echo [4/6] Installing Python dependencies...
echo This may take a few minutes...
call .venv\Scripts\activate.bat
python -m pip install --upgrade pip >nul 2>&1
pip install -r requirements.txt
if errorlevel 1 (
echo [ERROR] Failed to install Python dependencies!
pause
exit /b 1
)
echo [OK] Python dependencies installed.
echo.
REM Pull Ollama models
echo [5/6] Downloading AI models (this may take 10-20 minutes)...
echo.
echo Downloading and creating custom models...
cd modelfiles
echo - Creating gpt-oss model...
ollama create -f gpt-oss-20b-modelfile.txt gpt-oss
if errorlevel 1 (
echo [WARNING] Failed to create gpt-oss model!
)
echo - Creating llama3.2 model...
ollama create -f llama3.2-modelfile.txt llama3.2
if errorlevel 1 (
echo [WARNING] Failed to create llama3.2 model!
)
echo - Initializing gpt-oss model...
echo /bye | ollama run gpt-oss >nul 2>&1
echo - Initializing llama3.2 model...
echo /bye | ollama run llama3.2 >nul 2>&1
echo - Downloading embedding model...
ollama pull mxbai-embed-large
if errorlevel 1 (
echo [WARNING] Failed to download embedding model!
)
cd ..
echo [OK] AI models downloaded.
echo.
REM Create input folder if it doesn't exist
if not exist "input" (
mkdir input
echo Sample documents folder created: input\
)
REM Run config wizard
echo [6/6] Setting up configuration...
echo.
if not exist "config.json" (
echo No config.json found. Running configuration wizard...
python config_wizard.py
if errorlevel 1 (
echo [WARNING] Configuration wizard failed or was cancelled.
echo You'll need to create config.json manually before running the bot.
)
) else (
echo [OK] config.json already exists.
set /p RECONFIG="Do you want to reconfigure? (y/n): "
if /i "!RECONFIG!"=="y" (
python config_wizard.py
)
)
echo.
echo ============================================
echo Setup Complete!
echo ============================================
echo.
echo Next steps:
echo 1. Add your documents to the 'input' folder
echo 2. Double-click 'start.bat' to run the bot
echo.
echo For help, see BEGINNER_GUIDE.md
echo.
pause