File size: 1,152 Bytes
e2bfccc
 
 
 
 
 
 
 
a76fd89
 
 
 
 
 
 
 
 
 
 
e2bfccc
a76fd89
 
e2bfccc
a76fd89
 
 
e2bfccc
a76fd89
e2bfccc
 
 
 
 
 
 
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
30
31
32
33
34
35
36
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