Spaces:
Sleeping
Sleeping
File size: 1,282 Bytes
4e9edc4 1cef730 4e9edc4 7da0560 4e9edc4 320be5d 4e9edc4 7da0560 7ce346f 4e9edc4 491d59e 4e9edc4 23348af 4e9edc4 23348af 4e9edc4 23348af 4e9edc4 52659cf 4e9edc4 | 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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | FROM python:3.11-slim AS builder
WORKDIR /build
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 --shallow-submodules \
https://github.com/mudler/locate-anything.cpp.git /src \
&& cd /src && git submodule update --init --depth 1 --recursive
RUN cmake -S /src -B /src/build \
-DCMAKE_BUILD_TYPE=Release \
-DLA_BUILD_CLI=ON \
-DLA_BUILD_TESTS=OFF \
-DLA_SHARED=OFF \
&& cmake --build /src/build -j2 \
&& cp /src/build/examples/cli/locate-anything-cli /usr/local/bin/
FROM python:3.11-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
libstdc++6 \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/bin/locate-anything-cli /usr/local/bin/
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY download_model.py /app/download_model.py
RUN python /app/download_model.py
COPY app.py /app/app.py
WORKDIR /app
ENV MODEL_PATH=/app/models/locate-anything-q4_k.gguf
ENV HOST=0.0.0.0
ENV PORT=7860
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|