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 lines1314151617181920212223242512 unmodified linesARG IS_LOCAL=falseENV IS_LOCAL=${IS_LOCAL}# Install Python dependencies first (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 && \if [ "$IS_LOCAL" = "true" ]; then \pip install --no-cache-dir -r requirements-dev.txt; \fi# Copy the application12 unmodified lines1314151617181920212223242526272812 unmodified linesARG IS_LOCAL=falseENV IS_LOCAL=${IS_LOCAL}# Install Python dependencies based on mode (better layer caching)COPY --chown=user requirements.txt .COPY --chown=user requirements-dev.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 application
59 unmodified lines606162636465666715 unmodified lines83848586878889909159 unmodified lineselse# Interactive mode selectionecho "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 ""while true; do15 unmodified linesecho ""if [ "$MODE" = "local" ]; thenecho "🏠 Building in LOCAL mode (MedAlpaca-13b)..."docker build --build-arg IS_LOCAL=true -t medai-processing:local .elseecho "☁️ Building in CLOUD mode (NVIDIA/Gemini APIs)..."docker build --build-arg IS_LOCAL=false -t medai-processing:cloud .fi59 unmodified lines606162636465666715 unmodified lines8384858687888990919293949559 unmodified lineselse# Interactive mode selectionecho "Please select the runtime mode:"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 linesecho ""if [ "$MODE" = "local" ]; thenecho "🏠 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 .elseecho "☁️ 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
1234561 unmodified line8910# Local mode dependencies for MedAlpaca-13b inferencetorch>=2.0.0torch-cuda>=2.0.0accelerate>=0.20.0bitsandbytes>=0.41.0peft>=0.4.01 unmodified lineevaluate>=0.4.0scipy>=1.10.0scikit-learn>=1.3.01234567891011121314151617181 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 mode
1234567891011121314151617fastapiuvicorn[standard]python-dotenvhuggingface_hubrequestsgoogle-genaigoogle-api-python-clientgoogle-authgoogle-auth-httplib2google-auth-oauthliborjsonftfylangidtransformerstorchsentencepiecesacremoses12345678910111213141516171819202122232425# 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-oauthlib# Vietnamese translation (Opus model fallback)transformerstorchsentencepiecesacremoses# Note: Heavy local LLM dependencies (accelerate, bitsandbytes, etc.) are excluded for cloud mode
Dockerfile+6-3
build.sh+6-2
requirements-dev.txt+17
requirements.txt+11-3