-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.sh
More file actions
82 lines (71 loc) · 2.5 KB
/
Copy pathsetup.sh
File metadata and controls
82 lines (71 loc) · 2.5 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
#!/usr/bin/env bash
# ============================================================================
# Semantixel — Setup Script (Unix / macOS / Linux)
# ============================================================================
# Usage: bash setup.sh [env_name]
#
# Default env_name: semantixel
#
# Steps performed:
# 1. Create conda environment with Python 3.11
# 2. Install PyTorch with GPU (CUDA 12.1) support via conda
# 3. Install remaining Python dependencies via pip
# 4. Generate default config.yaml if missing
# ============================================================================
set -euo pipefail
ENV_NAME="${1:-semantixel}"
PYTHON_VERSION="3.11"
echo "==> Creating conda environment '${ENV_NAME}' with Python ${PYTHON_VERSION}..."
conda create -y -n "${ENV_NAME}" python="${PYTHON_VERSION}"
echo "==> Activating environment..."
eval "$(conda shell.bash hook)"
conda activate "${ENV_NAME}"
echo "==> Installing PyTorch with CUDA 12.4 support via pip..."
echo " (For CPU-only, use: pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu)"
echo " (For CUDA 11.8, use: --index-url https://download.pytorch.org/whl/cu118)"
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
echo "==> Installing project dependencies..."
pip install -e .
echo "==> Creating default config.yaml if missing..."
if [ ! -f config.yaml ]; then
cat > config.yaml << 'YAML'
port: 23107
batch_size: 16
deep_scan: true
ocr_provider: "doctr"
scan_method: "default"
exclude_directories: []
include_directories: []
clip:
HF_transformers_clip: "openai/clip-vit-base-patch32"
mobileclip_checkpoint: "mobileclip_s0"
provider: "HF_transformers"
text_embed:
HF_transformers_embeddings: "sentence-transformers/all-MiniLM-L6-v2"
provider: "HF_transformers"
audio:
enabled: true
transcription_enabled: true
clap_enabled: true
max_duration_seconds: 0
HF_transformers_whisper: "openai/whisper-tiny"
faster_whisper_model: "tiny.en"
provider: "faster_whisper"
transcription_max_duration: 60.0
google_drive:
enabled: false
token_file: "google_drive_token.json"
folder_ids: []
include_shared_drives: false
page_size: 100
YAML
echo " -> config.yaml created."
else
echo " -> config.yaml already exists."
fi
echo ""
echo "============================================"
echo " Semantixel setup complete!"
echo " Activate: conda activate ${ENV_NAME}"
echo " Run: python main.py"
echo "============================================"