diff --git a/lit_nlp/examples/gcp/Dockerfile b/lit_nlp/examples/gcp/Dockerfile index 3f6a5536..3b29c337 100644 --- a/lit_nlp/examples/gcp/Dockerfile +++ b/lit_nlp/examples/gcp/Dockerfile @@ -95,6 +95,8 @@ COPY ./lit_nlp/examples/gcp/model_server_gunicorn_config.py ./ # TODO(b/353980272): Replace this with a requirements file specific to the GCP # exmaple, this should include the core lit-nlp package. COPY requirements_core.txt ./ +COPY lit_nlp/examples/prompt_debugging/requirements.txt \ + lit_nlp/examples/prompt_debugging/requirements.txt COPY lit_nlp/examples/gcp/requirements.txt lit_nlp/examples/gcp/requirements.txt RUN python -m pip install -r lit_nlp/examples/gcp/requirements.txt diff --git a/lit_nlp/examples/gcp/README.md b/lit_nlp/examples/gcp/README.md index d2efba25..7af966df 100644 --- a/lit_nlp/examples/gcp/README.md +++ b/lit_nlp/examples/gcp/README.md @@ -1,5 +1,35 @@ # Using LLMs in LIT on Google Cloud Platform +## Developing + +### Use a virtual environment + +```shell +# Create and activate the virtual environment +python3 -m venv ~/.venvs/lit-on-gcp +source ~/.venvs/lit-on-gcp/bin/activate + +# Install the requirements and LIT in editable mode +pip install -f ./lit_nlp/examples/gcp/requirements.txt +pip install -e . + +# Optionally, install tetsing requirements +pip install -f ./requirements_test.txt +``` + +### Build the Docker image + +```shell +docker build -f ./lit_nlp/examples/gcp/Dockerfile -t lit-app:gcp-dev . +``` + +### Run GPT-2 in a Docker container + +```shell +# Runs GPT-2 in Keras on Tensorflow +docker run --rm -p 5432:5432 -e MODEL_CONFIG=gpt2:gpt2_base_en lit-app:gcp-dev +``` + Architectural Notes * The `LitApp` HTTP API assumes that inputs will be passed around as diff --git a/lit_nlp/examples/gcp/requirements.txt b/lit_nlp/examples/gcp/requirements.txt index d5ee763a..9586f030 100644 --- a/lit_nlp/examples/gcp/requirements.txt +++ b/lit_nlp/examples/gcp/requirements.txt @@ -14,6 +14,7 @@ # ============================================================================== -r ../../../requirements_core.txt +-r ../prompt_debugging/requirements.txt google-cloud-aiplatform>=1.60.0 gunicorn>=20.1.0