Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| # Sistem bağımlılıkları | |
| RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/* | |
| # Python bağımlılıkları | |
| RUN pip install --no-cache-dir -r requirements.txt \ | |
| && pip install --no-cache-dir transformers sentencepiece matplotlib | |
| # Writable dizinler | |
| RUN mkdir -p /app/data/result2 /app/data/matplotlib_config /app/data/hf_cache \ | |
| && chmod -R 777 /app/data | |
| # Cache ENV değişkenleri | |
| ENV BASE_SAVE_DIR=/app/data/result2 | |
| ENV MPLCONFIGDIR=/app/data/matplotlib_config | |
| ENV HF_HOME=/app/data/hf_cache | |
| ENV TRANSFORMERS_CACHE=/app/data/hf_cache | |
| # BERT modelini önceden indir (runtime hatası engellemek için) | |
| RUN python -c "from transformers import AutoTokenizer, AutoModel; \ | |
| AutoTokenizer.from_pretrained('dbmdz/bert-base-turkish-cased', cache_dir='/app/data/hf_cache'); \ | |
| AutoModel.from_pretrained('dbmdz/bert-base-turkish-cased', cache_dir='/app/data/hf_cache')" | |
| COPY . . | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |