soyailabs / remove_token_from_history.ps1
SOY NV AI
Update: Hugging Face ๋ฐฐํฌ ์„ค์ • ๋ฐ EXAONE ํ†ตํ•ฉ ๊ฐœ์„ 
208adf4
raw
history blame
1.01 kB
# Git ํžˆ์Šคํ† ๋ฆฌ์—์„œ Hugging Face ํ† ํฐ ์ œ๊ฑฐ ์Šคํฌ๋ฆฝํŠธ
$token = "YOUR_HUGGINGFACE_TOKEN_HERE"
$files = @(
"EXAONE_์ถ”๊ฐ€_์•ˆ๋‚ด.md",
"add_exaone_with_token.py",
"download_exaone_model.py",
"install_exaone_direct.py",
"install_exaone_simple.py"
)
Write-Host "Git ํžˆ์Šคํ† ๋ฆฌ์—์„œ ํ† ํฐ ์ œ๊ฑฐ ์ค‘..."
# ๊ฐ ํŒŒ์ผ์— ๋Œ€ํ•ด filter-branch ์‹คํ–‰
foreach ($file in $files) {
Write-Host "์ฒ˜๋ฆฌ ์ค‘: $file"
# ํŒŒ์ผ์ด ์กด์žฌํ•˜๋Š” ์ปค๋ฐ‹๋งŒ ์ฒ˜๋ฆฌ
$commits = git log --all --pretty=format:"%H" -- "$file" 2>$null
if ($commits) {
# PowerShell์„ ์‚ฌ์šฉํ•˜์—ฌ ํŒŒ์ผ ๋‚ด์šฉ ์ˆ˜์ •
git filter-branch --force --tree-filter @"
if [ -f "$file" ]; then
sed -i 's/$token/YOUR_HUGGINGFACE_TOKEN_HERE/g' "$file" 2>/dev/null || \
(powershell -Command "(Get-Content '$file') -replace '$token', 'YOUR_HUGGINGFACE_TOKEN_HERE' | Set-Content '$file'")
fi
"@ --prune-empty --tag-name-filter cat -- --all 2>&1 | Out-Null
}
}
Write-Host "์™„๋ฃŒ!"