-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_docker.sh
More file actions
executable file
Β·46 lines (36 loc) Β· 1.28 KB
/
build_docker.sh
File metadata and controls
executable file
Β·46 lines (36 loc) Β· 1.28 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
#!/bin/bash
# Script to build Docker container with T5 model
set -e
echo "π³ Building RAG QA System Docker Container"
echo "=========================================="
# Check if the source model directory exists
SOURCE_MODEL_DIR="/home/fg12/.cache/huggingface/hub/models--t5-small"
if [ ! -d "$SOURCE_MODEL_DIR" ]; then
echo "β Error: Source model directory not found: $SOURCE_MODEL_DIR"
echo "Please make sure the T5 model is downloaded to the correct location."
exit 1
fi
# Create models directory if it doesn't exist
echo "π Creating models directory..."
mkdir -p models
# Copy the T5 model to the local models directory
echo "π Copying T5 model to local models directory..."
cp -r "$SOURCE_MODEL_DIR" models/
# Verify the model was copied
if [ ! -d "models/models--t5-small" ]; then
echo "β Error: Failed to copy model to models directory"
exit 1
fi
echo "β
Model copied successfully"
# Build the Docker image
echo "π¨ Building Docker image..."
docker build -t rag-qa-system .
echo "β
Docker image built successfully!"
echo ""
echo "π To run the container:"
echo " docker run -p 8501:8501 rag-qa-system"
echo ""
echo " Or use docker-compose:"
echo " docker-compose up"
echo ""
echo "π The application will be available at: http://localhost:8501"