File size: 762 Bytes
c8abb98
06aa71a
c8abb98
 
 
06aa71a
c8abb98
 
 
e183a62
 
 
3d35004
06aa71a
 
0f9a58d
c92ce3d
c8abb98
e183a62
06aa71a
3fa890c
06aa71a
e183a62
06aa71a
8cdfdfe
c8abb98
06aa71a
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
#!/bin/bash

set -e

if [ -z "$sc4sc_token" ]; then
  echo "❌ Error: Environment variable sc4sc_token is not set."
  exit 1
fi

# Ensure user bin is on the path
export PATH="$HOME/.local/bin:$PATH"

# Install huggingface_hub CLI if needed
if ! command -v huggingface-cli &> /dev/null; then
  echo "πŸ”§ Installing huggingface_hub CLI..."
  pip install "huggingface_hub[cli]" --break-system-packages
fi

# Secure login
echo "πŸ” Logging into Hugging Face CLI..."
huggingface-cli login --token "$sc4sc_token" > /dev/null && echo "βœ… Login successful."

# Upload
echo "πŸ“€ Uploading to Hugging Face Space: sc4sc/editor"
huggingface-cli upload sc4sc/editor . --repo-type=space --include="*" --include-git-ignore=false

echo "βœ… Upload completed successfully."