Download run.ps1 from MoBkr/dosemate: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/spaces/MoBkr/dosemate/resolve/main/run.ps1
- Command line
-
hf download hf://spaces/MoBkr/dosemate/run.ps1
-
curl -L -o run.ps1 https://huggingface.co/spaces/MoBkr/dosemate/resolve/main/run.ps1
1.24 kB
| # PharmaChat — one-command production runner. | |
| # Builds whatever is missing, then starts ONE server (API + UI) on http://localhost:8000 | |
| # | |
| # Right-click -> Run with PowerShell, or: powershell -ExecutionPolicy Bypass -File run.ps1 | |
| $ErrorActionPreference = "Stop" | |
| $dir = $PSScriptRoot | |
| Set-Location $dir | |
| Write-Host "PharmaChat launcher" -ForegroundColor Green | |
| # 1) .env must exist | |
| if (-not (Test-Path "$dir/.env")) { | |
| Write-Host "ERROR: .env not found. Copy .env.example to .env and add GROQ_API_KEY + GOOGLE_API_KEY." -ForegroundColor Red | |
| exit 1 | |
| } | |
| # 2) Build the vector store if missing | |
| if (-not (Test-Path "$dir/chroma_db")) { | |
| Write-Host "Building ChromaDB (one-time)..." -ForegroundColor Cyan | |
| python build_chroma.py | |
| } | |
| # 3) Build the frontend if missing | |
| if (-not (Test-Path "$dir/frontend/dist/index.html")) { | |
| Write-Host "Building frontend (one-time)..." -ForegroundColor Cyan | |
| Push-Location "$dir/frontend" | |
| if (-not (Test-Path "node_modules")) { npm install } | |
| npm run build | |
| Pop-Location | |
| } | |
| # 4) Start the single server | |
| Write-Host "Starting PharmaChat on http://localhost:8000 ..." -ForegroundColor Green | |
| Start-Process "http://localhost:8000" | |
| python -m uvicorn main:app --host 0.0.0.0 --port 8000 | |