Download scripts/dev.ps1 from Prerna43/ai: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/Prerna43/ai/resolve/main/scripts/dev.ps1
- Command line
-
hf download hf://spaces/Prerna43/ai/scripts/dev.ps1
-
curl -L -o dev.ps1 https://huggingface.co/spaces/Prerna43/ai/resolve/main/scripts/dev.ps1
1.16 kB
| param( | |
| [switch]$Infra, | |
| [switch]$Backend, | |
| [switch]$Frontend, | |
| [switch]$All | |
| ) | |
| $ErrorActionPreference = "Stop" | |
| $Root = Resolve-Path (Join-Path $PSScriptRoot "..") | |
| Set-Location $Root | |
| if (-not $Infra -and -not $Backend -and -not $Frontend -and -not $All) { | |
| $All = $true | |
| } | |
| function Start-Infra { | |
| Write-Host "Starting Qdrant and Neo4j with Docker Compose..." | |
| docker compose up -d qdrant neo4j | |
| } | |
| function Start-Backend { | |
| Write-Host "Starting FastAPI backend at http://localhost:8000 ..." | |
| if (Test-Path ".\env\Scripts\Activate.ps1") { | |
| . ".\env\Scripts\Activate.ps1" | |
| } | |
| uvicorn backend.main:app --reload | |
| } | |
| function Start-Frontend { | |
| Write-Host "Starting Streamlit frontend at http://localhost:8501 ..." | |
| if (Test-Path ".\env\Scripts\Activate.ps1") { | |
| . ".\env\Scripts\Activate.ps1" | |
| } | |
| streamlit run frontend/app.py | |
| } | |
| if ($All -or $Infra) { | |
| Start-Infra | |
| } | |
| if ($Backend -and $Frontend) { | |
| Write-Host "Open two terminals for backend and frontend, or run this script with one flag at a time." | |
| exit 1 | |
| } | |
| if ($All -or $Backend) { | |
| Start-Backend | |
| } | |
| if ($Frontend) { | |
| Start-Frontend | |
| } | |