File size: 1,978 Bytes
d3c9c0b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Deploy Week 8 "The Price is Right" to Hugging Face Space: prabalGaur/Capstone
 #Run: powershell -ExecutionPolicy Bypass -File week8/deploy_to_hf.ps1

$ErrorActionPreference = "Stop"
$Week8 = "$PSScriptRoot"
$DeployDir = "$Week8\_hf_deploy"

Write-Host "=== Preparing deployment bundle (no 1.1GB weights file) ===" -ForegroundColor Cyan

if (Test-Path $DeployDir) { Remove-Item $DeployDir -Recurse -Force }
New-Item -ItemType Directory -Path $DeployDir | Out-Null
New-Item -ItemType Directory -Path "$DeployDir\agents" | Out-Null

Copy-Item "$Week8\price_is_right.py" $DeployDir
Copy-Item "$Week8\deal_agent_framework.py" $DeployDir
Copy-Item "$Week8\log_utils.py" $DeployDir
Copy-Item "$Week8\free_config.py" $DeployDir
Copy-Item "$Week8\env_utils.py" $DeployDir
Copy-Item "$Week8\memory.json" $DeployDir
Copy-Item "$Week8\huggingface_space\app.py" $DeployDir
Copy-Item "$Week8\huggingface_space\requirements.txt" $DeployDir
Copy-Item "$Week8\huggingface_space\README.md" $DeployDir
Get-ChildItem "$Week8\agents\*.py" | Copy-Item -Destination "$DeployDir\agents\"
Copy-Item "$Week8\products_vectorstore" $DeployDir -Recurse

Write-Host "Uploading to prabalGaur/Capstone via Hugging Face API..." -ForegroundColor Cyan
Set-Location (Split-Path $Week8 -Parent)
uv run python -c @"

from huggingface_hub import HfApi

api = HfApi()

api.upload_folder(

    folder_path=r'$DeployDir',

    repo_id='prabalGaur/Capstone',

    repo_type='space',

    commit_message='Deploy capstone app (Frontier + Groq specialist, no 1GB weights)',

)

print('Upload complete!')

"@

Write-Host ""
Write-Host "Live URL: https://huggingface.co/spaces/prabalGaur/Capstone" -ForegroundColor Green
Write-Host ""
Write-Host "Add Space SECRETS (Settings -> Secrets):" -ForegroundColor Yellow
Write-Host "  GROQ_API_KEY, HF_TOKEN, USE_MODAL_SPECIALIST=false"
Write-Host "  GRADIO_SERVER_NAME=0.0.0.0"
Write-Host "  PRICER_PREPROCESSOR_MODEL=groq/llama-3.1-8b-instant"