-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_code.sh
More file actions
53 lines (45 loc) · 1.18 KB
/
run_code.sh
File metadata and controls
53 lines (45 loc) · 1.18 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
#!/usr/bin/env bash
#####################################################################
# KG2x Node Embedding Runner
#
# Wrapper script for embed_kg2nodes.py
# Uses nodes_cleaned.tsv as input and generates embeddings into ./chromadb
#
# Usage:
# bash run_embedder.sh [-v]
#
# Options:
# -v Enable verbose mode (passes through to embed_kg2nodes.py)
#
#####################################################################
# Fixed parameters
INPUT_FILE="nodes_cleaned.tsv"
OUTPUT_DIR="./chromadb"
COLLECTION="kg2103"
MODE="new"
VERBOSE=""
# Parse optional -v flag
while getopts "v" opt; do
case $opt in
v)
VERBOSE="-v"
;;
esac
done
# Check for required input file
if [ ! -f "$INPUT_FILE" ]; then
echo "[ERROR] Input file '$INPUT_FILE' not found."
exit 1
fi
# Ensure Python environment exists
if ! command -v python3 &> /dev/null; then
echo "[ERROR] Python3 not found. Please activate your virtual environment."
exit 1
fi
# Run the embedder
python3 embed_kg2nodes.py -i "$INPUT_FILE" -o "$OUTPUT_DIR" -c "$COLLECTION" -m "$MODE" $VERBOSE
# Exit status
if [ $? -ne 0 ]; then
echo "[ERROR] Embedding process failed. Check log output above."
exit 1
fi