File size: 665 Bytes
a64600b
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
param([string]$Storage=(Join-Path (Split-Path $PSScriptRoot -Parent) 'runtime'),
      [string]$Image='snf-five-models:cu128',
      [Parameter(ValueFromRemainingArguments=$true)][string[]]$Command=@('doctor'))
$ErrorActionPreference='Stop'
foreach ($dir in 'weights','data','outputs') { New-Item -ItemType Directory -Force -Path (Join-Path $Storage $dir) | Out-Null }
$resolved=(Resolve-Path -LiteralPath $Storage).Path
docker run --rm --gpus all --ipc=host --init -e HF_TOKEN -e HF_ENDPOINT `
    -v "${resolved}/weights:/weights" -v "${resolved}/data:/data" -v "${resolved}/outputs:/outputs" $Image @Command
if ($LASTEXITCODE -ne 0) { throw 'Container failed' }