File size: 2,323 Bytes
c87f72b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# Push VAMGUARD_TITAN to HuggingFace repository

set -e

echo "================================================"
echo "πŸ“€ Pushing to HuggingFace: DJ-Goanna-Coding"
echo "================================================"
echo ""

# Check if HF_TOKEN is set
if [ -z "$HF_TOKEN" ]; then
    echo "⚠️  HF_TOKEN environment variable not set"
    echo "   Please set your HuggingFace token:"
    echo "   export HF_TOKEN='your_token_here'"
    exit 1
fi

echo "βœ… HF_TOKEN found"
echo ""

# Get repository info
REPO_NAME="VAMGUARD_TITAN"
HF_USERNAME="DJ-Goanna-Coding"
HF_SPACE_NAME="TIA-ARCHITECT-CORE"

echo "πŸ“‹ Repository Information:"
echo "   GitHub Repo: DJ-Goana-Coding/$REPO_NAME"
echo "   HF Username: $HF_USERNAME"
echo "   HF Space: $HF_SPACE_NAME"
echo ""

# Check if we're in a git repository
if [ ! -d .git ]; then
    echo "❌ Not in a git repository"
    exit 1
fi

echo "βœ… Git repository detected"
echo ""

# Add HuggingFace remote if it doesn't exist
HF_REMOTE_URL="https://huggingface.co/spaces/$HF_USERNAME/$HF_SPACE_NAME"

if git remote get-url huggingface 2>/dev/null; then
    echo "πŸ“‘ HuggingFace remote already exists"
    git remote set-url huggingface "$HF_REMOTE_URL"
else
    echo "πŸ“‘ Adding HuggingFace remote"
    git remote add huggingface "$HF_REMOTE_URL"
fi

echo "   Remote URL: $HF_REMOTE_URL"
echo ""

# Get current branch
CURRENT_BRANCH=$(git branch --show-current)
echo "🌿 Current branch: $CURRENT_BRANCH"
echo ""

# Show what will be pushed
echo "πŸ“Š Files to be pushed:"
git ls-files | head -20
echo "   ... and more"
echo ""

# Confirm push
read -p "πŸš€ Push to HuggingFace? (y/N): " -n 1 -r
echo ""

if [[ ! $REPLY =~ ^[Yy]$ ]]; then
    echo "❌ Push cancelled"
    exit 0
fi

echo ""
echo "πŸš€ Pushing to HuggingFace..."
echo ""

# Configure git to use token
git config --local credential.helper store

# Push to HuggingFace
git push huggingface $CURRENT_BRANCH:main --force

echo ""
echo "================================================"
echo "βœ… Successfully pushed to HuggingFace!"
echo "================================================"
echo ""
echo "🌐 View your space at:"
echo "   https://huggingface.co/spaces/$HF_USERNAME/$HF_SPACE_NAME"
echo ""
echo "πŸ“ Note: It may take a few minutes for HuggingFace to rebuild your space"
echo ""