Spaces:
Running
Running
File size: 1,092 Bytes
74626f2 | 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 | # Hugging Face Deployment Script for NL Main
$HF_TOKEN = $env:HF_TOKEN # Set this in your local environment
if (-not $HF_TOKEN) { $HF_TOKEN = "YOUR_HF_TOKEN_HERE" }
$HF_USERNAME = "minowau" # Guessed from GitHub remote
$SPACE_NAME = "NavigatedLearning"
Write-Host "--- 1. Building Frontend ---" -ForegroundColor Cyan
npm run build
Write-Host "--- 2. Setting up Hugging Face Remote ---" -ForegroundColor Cyan
$HF_REMOTE_URL = "https://user:$($HF_TOKEN)@huggingface.co/spaces/$($HF_USERNAME)/$($SPACE_NAME)"
# Check if HF remote already exists
$existingRemote = git remote | Select-String "^hf$"
if ($existingRemote) {
git remote set-url hf $HF_REMOTE_URL
} else {
git remote add hf $HF_REMOTE_URL
}
Write-Host "--- 3. Pushing to Hugging Face ---" -ForegroundColor Cyan
# Ensure we are on a branch
$currentBranch = git rev-parse --abbrev-ref HEAD
git push hf "$($currentBranch):main" --force
Write-Host "--- Deployment Request Sent! ---" -ForegroundColor Green
Write-Host "Check your Space at: https://huggingface.co/spaces/$($HF_USERNAME)/$($SPACE_NAME)" -ForegroundColor Yellow
|