-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·64 lines (54 loc) · 2.06 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·64 lines (54 loc) · 2.06 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
#!/bin/bash
# Parse command line arguments
INSTALL_MINIRAG=false
while [[ "$#" -gt 0 ]]; do
case $1 in
--with-minirag) INSTALL_MINIRAG=true ;;
*) echo "Unknown parameter: $1"; exit 1 ;;
esac
shift
done
# Create virtual environment
python -m venv venv
# Activate virtual environment
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Install MiniRAG if requested
if [ "$INSTALL_MINIRAG" = true ]; then
echo "Installing MiniRAG..."
pip install lightrag-hku[api]
echo "MiniRAG installed."
fi
# Create .env file if it doesn't exist
if [ ! -f .env ]; then
cp .env.example .env
echo "Created .env file from .env.example. Please edit it to add your API keys."
fi
# Create necessary directories
mkdir -p data/papers
mkdir -p data/index
mkdir -p data/storage
echo "Setup complete."
echo ""
if [ "$INSTALL_MINIRAG" = true ]; then
echo "To start the MiniRAG server with OpenAI embeddings, run:"
echo "python start_minirag.py"
echo ""
echo "This script will read configuration from your .env file and start the MiniRAG server with the correct settings."
echo ""
echo "Alternatively, you can start the server manually:"
echo "lightrag-server --working-dir ./data/storage --chunk-size 1000 --chunk-overlap-size 200 --embedding-dim 1536 --cosine-threshold 0.4 --top-k 5 --embedding-binding openai --embedding-model text-embedding-3-small"
echo ""
echo "Make sure to set your OpenAI API key in the .env file or pass it directly:"
echo "lightrag-server --working-dir ./data/storage --chunk-size 1000 --chunk-overlap-size 200 --embedding-dim 1536 --cosine-threshold 0.4 --top-k 5 --embedding-binding openai --embedding-model text-embedding-3-small --openai-api-key your_openai_api_key_here"
echo ""
echo "Then, in a separate terminal, run the application with:"
echo "python run.py"
else
echo "You can now run the application with:"
echo "python run.py"
echo ""
echo "Note: For full functionality, you can install MiniRAG later with:"
echo "./setup.sh --with-minirag"
fi