|
| 1 | +@echo off |
| 2 | +REM Load variables from .env if it exists |
| 3 | +if exist .env ( |
| 4 | + for /f "usebackq tokens=1,* delims==" %%i in (".env") do ( |
| 5 | + set %%i=%%j |
| 6 | + ) |
| 7 | +) |
| 8 | + |
| 9 | +set TARGET=%1 |
| 10 | + |
| 11 | +if "%TARGET%"=="" ( |
| 12 | + echo Usage: build.bat [target] |
| 13 | + echo Available targets: |
| 14 | + echo flower |
| 15 | + echo install-openapi-generator |
| 16 | + echo generate-client |
| 17 | + echo install-mock-server |
| 18 | + echo start-mock-server |
| 19 | + echo gen-envs |
| 20 | + echo download-diffdock-weights |
| 21 | + echo download-esmfold-weights |
| 22 | + echo download-rfdiffusion-weights |
| 23 | + echo download-arxiv-abstracts-db |
| 24 | + exit /b 1 |
| 25 | +) |
| 26 | + |
| 27 | +if "%TARGET%"=="flower" ( |
| 28 | + celery --broker=%REDIS_URL% flower --port=5555 |
| 29 | + goto :EOF |
| 30 | +) |
| 31 | + |
| 32 | +if "%TARGET%"=="install-openapi-generator" ( |
| 33 | + npm install -g openapi-typescript-codegen |
| 34 | + goto :EOF |
| 35 | +) |
| 36 | + |
| 37 | +if "%TARGET%"=="generate-client" ( |
| 38 | + openapi --input "http://127.0.0.1:8000/openapi.json" --output frontend/src/api/client --client axios |
| 39 | + goto :EOF |
| 40 | +) |
| 41 | + |
| 42 | +if "%TARGET%"=="install-mock-server" ( |
| 43 | + npm install -g @stoplight/prism-cli |
| 44 | + goto :EOF |
| 45 | +) |
| 46 | + |
| 47 | +if "%TARGET%"=="start-mock-server" ( |
| 48 | + prism mock http://127.0.0.1:%UVICORN_HOST%/openapi.json |
| 49 | + goto :EOF |
| 50 | +) |
| 51 | + |
| 52 | +if "%TARGET%"=="gen-envs" ( |
| 53 | + python3 scripts/gen_envs.py |
| 54 | + goto :EOF |
| 55 | +) |
| 56 | + |
| 57 | +if "%TARGET%"=="download-diffdock-weights" ( |
| 58 | + echo Downloading diffdock model weights... |
| 59 | + if not exist "%DIFFDOCK_WEIGHTS_LOCATION%" mkdir "%DIFFDOCK_WEIGHTS_LOCATION%" |
| 60 | + python3 microservices/diffdock/scripts/download_weights.py |
| 61 | + echo Download complete! |
| 62 | + goto :EOF |
| 63 | +) |
| 64 | + |
| 65 | +if "%TARGET%"=="download-esmfold-weights" ( |
| 66 | + echo Downloading esmfold model weights... |
| 67 | + if not exist "%ESMFOLD_WEIGHTS_LOCATION%" mkdir "%ESMFOLD_WEIGHTS_LOCATION%" |
| 68 | + pip3 install transformers[torch] --verbose |
| 69 | + python3 microservices/esmfold/scripts/download_weights.py |
| 70 | + echo Download complete! |
| 71 | + goto :EOF |
| 72 | +) |
| 73 | + |
| 74 | +if "%TARGET%"=="download-rfdiffusion-weights" ( |
| 75 | + echo Downloading rfdiffusion model weights... |
| 76 | + if not exist "%RFDIFFUSION_WEIGHTS_LOCATION%" mkdir "%RFDIFFUSION_WEIGHTS_LOCATION%" |
| 77 | + python3 microservices/rfdiffusion/scripts/download_weights.py |
| 78 | + echo Download complete! |
| 79 | + goto :EOF |
| 80 | +) |
| 81 | + |
| 82 | +if "%TARGET%"=="download-arxiv-abstracts-db" ( |
| 83 | + echo Downloading arxiv abstracts |
| 84 | + where unzip >nul 2>nul |
| 85 | + if errorlevel 1 ( |
| 86 | + echo You must install unzip. For example: |
| 87 | + echo choco install unzip (if using Chocolatey) |
| 88 | + goto :EOF |
| 89 | + ) |
| 90 | + if not exist "%ARXIV_ABSTRACTS_DB%" mkdir "%ARXIV_ABSTRACTS_DB%" |
| 91 | + curl -L -o "%ARXIV_ABSTRACTS_DB%\chroma_db.zip" https://www.kaggle.com/api/v1/datasets/download/timurishmuratov/nolabs-arxiv-abstract-vector-db |
| 92 | + powershell -Command "Expand-Archive '%ARXIV_ABSTRACTS_DB%\chroma_db.zip' '%ARXIV_ABSTRACTS_DB%'" |
| 93 | + del "%ARXIV_ABSTRACTS_DB%\chroma_db.zip" |
| 94 | + echo Download complete! |
| 95 | + goto :EOF |
| 96 | +) |
| 97 | + |
| 98 | +echo Unknown target "%TARGET%" |
| 99 | +exit /b 1 |
0 commit comments