File size: 985 Bytes
64744a7
 
 
 
 
 
 
 
f1801f1
 
 
c77ada1
64744a7
 
f1801f1
 
 
c77ada1
64744a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Hugging Face Spaces: FastAPI + ASR (CPU-only)
FROM python:3.10-slim

# Install system deps
RUN apt-get update && apt-get install -y \
    ffmpeg libsndfile1 git curl build-essential && \
    rm -rf /var/lib/apt/lists/*

# RUN git clone https://github.com/VarunGumma/IndicTransToolkit \
#  && cd IndicTransToolkit \
#  && pip install --editable . --use-pep517

WORKDIR /code

# # Set HF cache to a writable directory
# ENV HF_HOME=/code/app/hf_cache
# ENV TRANSFORMERS_CACHE=/code/app/hf_cache

# Copy code
COPY ./app /code/app

# Create hf_cache and make it world-writable so the non-root runtime user can use it
RUN mkdir -p /code/app/hf_cache \
  && chmod -R a+rwX /code/app/hf_cache

# Copy and install Python dependencies
COPY requirements.txt ./

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Expose default port for HF Spaces
EXPOSE 7860

# Entrypoint for FastAPI app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]