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