Skip to content

Instantly share code, notes, and snippets.

@samclane
Created March 20, 2023 15:42
Show Gist options
  • Save samclane/f6e0558cc03c5ec85eaaf0080eec1c0f to your computer and use it in GitHub Desktop.
Save samclane/f6e0558cc03c5ec85eaaf0080eec1c0f to your computer and use it in GitHub Desktop.
Docker to run alpaca.cpp (hopefully)
# Use Ubuntu as the base image
FROM ubuntu:20.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Update and install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
curl \
ca-certificates \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Clone the Alpaca.cpp repository
RUN git clone https://github.com/antimatter15/alpaca.cpp /alpaca
# Build the project
WORKDIR /alpaca
RUN cmake . && \
cmake --build . --config Release
# Download the weights
RUN curl -o ggml-alpaca-7b-q4.bin -C - https://gateway.estuary.tech/gw/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC
# Expose a port to interact with the model
EXPOSE 8080
# Run the chat executable
CMD ["./chat"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment