Chisael-Nexythra / upload.ps1
PureOne's picture
Upload CHISAEL-NEXYTHRA II research dataset v1.0.0
93a77c9 verified
Raw History Blame Contribute Delete
924 Bytes
param(
[Parameter(Position = 0)] [string] $RepoId,
[switch] $Private,
[switch] $DryRun,
[string] $Revision
)
$ErrorActionPreference = "Stop"
$UploadArguments = @((Join-Path $PSScriptRoot "scripts/upload_dataset.py"))
if ($RepoId) { $UploadArguments += $RepoId }
if ($Private) { $UploadArguments += "--private" }
if ($DryRun) { $UploadArguments += "--dry-run" }
if ($Revision) { $UploadArguments += @("--revision", $Revision) }
if (Get-Command py -ErrorAction SilentlyContinue) {
& py -3 @UploadArguments
} elseif (Get-Command python -ErrorAction SilentlyContinue) {
& python @UploadArguments
} else {
Write-Host "Python 3 is missing. Install Python 3, then rerun this script."
exit 1
}
$UploadExit = $LASTEXITCODE
if ($UploadExit -ne 0) {
Write-Host "Missing dependency: python -m pip install --upgrade huggingface_hub"
Write-Host "Authentication: hf auth login"
}
exit $UploadExit