File size: 1,917 Bytes
27caffe | 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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | # Upload local model weights to Hugging Face Hub.
# Prerequisites: pip install huggingface_hub && huggingface-cli login
#
# Usage (from repo root):
# .\scripts\upload_models.ps1 -Username IamSamk
param(
[Parameter(Mandatory = $true)]
[string]$Username,
[ValidateSet("public", "private")]
[string]$Visibility = "private"
)
$ErrorActionPreference = "Stop"
$Root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
$privateFlag = if ($Visibility -eq "private") { "--private" } else { "" }
function Ensure-Repo {
param([string]$Name, [string]$Type)
$exists = huggingface-cli repo info "$Username/$Name" 2>$null
if (-not $exists) {
Write-Host "Creating $Type repo: $Username/$Name"
if ($privateFlag) {
huggingface-cli repo create $Name --type $Type $privateFlag
} else {
huggingface-cli repo create $Name --type $Type
}
}
}
Ensure-Repo -Name "police-bot-f5tts" -Type "model"
Ensure-Repo -Name "sadtalker-checkpoints" -Type "model"
Ensure-Repo -Name "gfpgan-weights" -Type "model"
Write-Host "Uploading F5-TTS model..."
huggingface-cli upload "$Username/police-bot-f5tts" `
"$Root\my_finetuned_model" `
--include "model.pth" "dvae.pth" "mel_stats.pth" "config.json" "vocab.json"
Write-Host "Uploading SadTalker checkpoints..."
huggingface-cli upload "$Username/sadtalker-checkpoints" `
"$Root\sadtalker+wav2lip\sadtalker\checkpoints" `
--repo-type model
Write-Host "Uploading Wav2Lip checkpoint..."
huggingface-cli upload "$Username/sadtalker-checkpoints" `
"$Root\sadtalker+wav2lip\wav2lip\Wav2Lip-SD-NOGAN.pt" `
--repo-type model
Write-Host "Uploading GFPGAN weights..."
huggingface-cli upload "$Username/gfpgan-weights" `
"$Root\gfpgan\weights" `
--repo-type model
Write-Host "Upload complete. Update scripts/download_models.py if your username differs from IamSamkk."
|