File size: 1,979 Bytes
637183f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
# Auto-start backend once pre-computation completes

echo "πŸ” Monitoring pre-computation process..."
echo "πŸ“Š Log file: /Users/hamidaho/hf_viz/precompute_fast.log"
echo ""

# Wait for pre-computation to complete
while ps aux | grep -q "[p]recompute_fast.py"; do
    # Show latest progress
    LATEST=$(tail -1 /Users/hamidaho/hf_viz/precompute_fast.log 2>/dev/null | grep -E "Batches:|Step|INFO")
    if [ ! -z "$LATEST" ]; then
        echo -ne "\r⏳ $LATEST                    "
    fi
    sleep 5
done

echo ""
echo ""
echo "βœ… Pre-computation complete!"
echo ""

# Check if files were created successfully
if [ -f "/Users/hamidaho/hf_viz/precomputed_data/models_v1.parquet" ]; then
    echo "βœ… Found: models_v1.parquet"
    ls -lh /Users/hamidaho/hf_viz/precomputed_data/models_v1.parquet
else
    echo "❌ ERROR: models_v1.parquet not found"
    exit 1
fi

if [ -f "/Users/hamidaho/hf_viz/precomputed_data/embeddings_v1.parquet" ]; then
    echo "βœ… Found: embeddings_v1.parquet"
    ls -lh /Users/hamidaho/hf_viz/precomputed_data/embeddings_v1.parquet
else
    echo "❌ ERROR: embeddings_v1.parquet not found"
    exit 1
fi

if [ -f "/Users/hamidaho/hf_viz/precomputed_data/metadata_v1.json" ]; then
    echo "βœ… Found: metadata_v1.json"
    cat /Users/hamidaho/hf_viz/precomputed_data/metadata_v1.json | python3 -m json.tool 2>/dev/null | grep -E "total_models|unique_libraries|unique_pipelines" | head -3
else
    echo "❌ ERROR: metadata_v1.json not found"
    exit 1
fi

echo ""
echo "πŸš€ Starting backend server..."
echo ""

cd /Users/hamidaho/hf_viz/backend

# Kill any existing backend processes
pkill -f "uvicorn.*api.main:app" 2>/dev/null

# Start backend
source /Users/hamidaho/hf_viz/venv/bin/activate
uvicorn api.main:app --host 0.0.0.0 --port 8000 --reload

echo ""
echo "Backend started on http://localhost:8000"
echo "Frontend should be running on http://localhost:3000"
echo ""
echo "πŸ“Š Open your browser and refresh the page!"