TaoNet-mini-T2 / upload_large_folder.ps1
StarMist0012's picture
Add files using upload-large-folder tool
a76fd89 verified
param(
[string]$RepoId = "TaoTern/TaoNet-mini-T2",
[string]$HfExe = "hf"
)
$ErrorActionPreference = "Stop"
$Root = Split-Path -Parent $MyInvocation.MyCommand.Path
$BundledHf = "C:\Users\USER\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\Scripts\hf.exe"
if ($HfExe -eq "hf" -and -not (Get-Command $HfExe -ErrorAction SilentlyContinue) -and (Test-Path $BundledHf)) {
$HfExe = $BundledHf
}
if (-not (Get-Command $HfExe -ErrorAction SilentlyContinue) -and -not (Test-Path $HfExe)) {
Write-Host "Could not find Hugging Face CLI: $HfExe"
Write-Host "Install it with: pip install -U huggingface_hub[hf_xet]"
exit 1
}
if (-not $env:HF_TOKEN) {
$oldPreference = $ErrorActionPreference
$ErrorActionPreference = "Continue"
& $HfExe auth whoami *> $null
$whoamiExit = $LASTEXITCODE
$ErrorActionPreference = $oldPreference
if ($whoamiExit -ne 0) {
Write-Host "Not logged in to Hugging Face. Run one of these first:"
Write-Host " & `"$HfExe`" auth login"
Write-Host "or:"
Write-Host ' $env:HF_TOKEN="YOUR_TOKEN"'
exit 1
}
}
& $HfExe upload-large-folder $RepoId $Root --repo-type model --private