Spaces:
Runtime error
Runtime error
Commit ·
e0b2bb1
1
Parent(s): d668aec
Enh model prompting and sequential processing
Browse filesFiles changed (4)
- Dockerfile+6-3
- build.sh+6-2
- requirements-dev.txt+17
- requirements.txt+11-3
12 unmodified lines1314151616171818201920212223242526272812 unmodified linesARG IS_LOCAL=falseENV IS_LOCAL=${IS_LOCAL}
# Install Python dependencies first (better layer caching)# Install Python dependencies based on mode (better layer caching)COPY --chown=user requirements.txt .# Install local mode dependencies if IS_LOCAL is trueCOPY --chown=user requirements-dev.txt .RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt && \RUN pip install --upgrade pip && \ if [ "$IS_LOCAL" = "true" ]; then \ echo "Installing LOCAL mode dependencies (MedAlpaca-13b)"; \ pip install --no-cache-dir -r requirements-dev.txt; \ else \ echo "Installing CLOUD mode dependencies (NVIDIA/Gemini APIs)"; \ pip install --no-cache-dir -r requirements.txt; \ fi
# Copy the application59 unmodified lines6061626364636465666715 unmodified lines8384858687888990919293949559 unmodified lineselse # Interactive mode selection echo "Please select the runtime mode:" echo "1) Local mode (MedAlpaca-13b) - No API costs, complete privacy" echo "2) Cloud mode (NVIDIA/Gemini APIs) - Faster processing, requires API keys" echo "1) Local mode (MedAlpaca-13b) - No API costs, complete privacy, heavy dependencies" echo "2) Cloud mode (NVIDIA/Gemini APIs) - Faster processing, requires API keys, lightweight" echo "" while true; do15 unmodified lines echo "" if [ "$MODE" = "local" ]; then echo "🏠 Building in LOCAL mode (MedAlpaca-13b)..." echo " - Installing local LLM dependencies (torch-cuda, accelerate, bitsandbytes, etc.)" echo " - Excluding cloud API dependencies (google-genai, google-auth, etc.)" docker build --build-arg IS_LOCAL=true -t medai-processing:local . else echo "☁️ Building in CLOUD mode (NVIDIA/Gemini APIs)..." echo " - Installing cloud API dependencies (google-genai, google-auth, etc.)" echo " - Excluding heavy local LLM dependencies (torch-cuda, accelerate, bitsandbytes, etc.)" docker build --build-arg IS_LOCAL=false -t medai-processing:cloud . fi 1234567891011121314151617181 unmodified line2021222324252627# Local mode dependencies for MedAlpaca-13b inference# Core framework dependenciesfastapiuvicorn[standard]python-dotenvhuggingface_hubrequestsorjsonftfylangid
# Local LLM dependenciestorch>=2.0.0torch-cuda>=2.0.0transformers>=4.30.0accelerate>=0.20.0bitsandbytes>=0.41.0peft>=0.4.01 unmodified lineevaluate>=0.4.0scipy>=1.10.0scikit-learn>=1.3.0sentencepiecesacremoses
# Vietnamese translation (Opus model fallback)# Note: google-genai and google-auth packages are excluded for local mode12345678910111213141516171112131819202122232425# Cloud mode dependencies for NVIDIA/Gemini API integration# Core framework dependenciesfastapiuvicorn[standard]python-dotenvhuggingface_hubrequestsorjsonftfylangid
# Cloud API dependenciesgoogle-genaigoogle-api-python-clientgoogle-authgoogle-auth-httplib2google-auth-oauthliborjsonftfylangid
# Vietnamese translation (Opus model fallback)transformerstorchsentencepiecesacremoses
# Note: Heavy local LLM dependencies (accelerate, bitsandbytes, etc.) are excluded for cloud modeDockerfile+6-3
build.sh+6-2
requirements-dev.txt+17
requirements.txt+11-3