From b20c95760a1c1caf9a643f98fcab1d39c495f866 Mon Sep 17 00:00:00 2001 From: Brando Miranda Date: Mon, 29 Apr 2024 12:23:28 -0700 Subject: [PATCH] added conda install instructions that work for pypantrograph --- README.md | 40 ++++++++++++++++++++++++++++++++++++++-- pyproject.toml | 2 ++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d607e07..c0e3cc1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,19 @@ Python interface to the Pantograph library ## Getting started -Execute +First initialize the git submodules so that git can keep track of the submodules being used do: +```bash +# - initialize the git submodules by preparing the git repository, but it does not clone or fetch them, just init's git's internal configs +git submodule init +``` +Then to clone, fetch & update the submodules code (and also initilize anything you might have forgotten that is specificed in the `.gitmodules` file): +```bash +# - initialize the git submodules so that git can track them and then the update clone/fetches & updates the submodules +git submodule update --init +``` + +Then install poetry by [following instructions written for the Stanford SNAP cluster](https://github.com/brando90/snap-cluster-setup?tab=readme-ov-file#poetry) or [their official instructions](https://python-poetry.org/docs/#installing-manually). +Then once you confirm you have poetry & the initialized git submodules, execute: ```bash poetry build ``` @@ -15,4 +27,28 @@ python -m pantograph.server The tests in `pantograph/server.py` also serve as simple interaction examples -Test push \ No newline at end of file +## Install 2: With Conda and Pip in the SNAP cluster + +```bash +# install Lean4 manually (elan and lake) +curl -sSf https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh | sh -s -- -y + +# create and activate the right python env (this is needed so that poetry build works) +conda create -n pypantograph_env python=3.11 -y +conda activate pypantograph_env + +# build the PyPantograph proj (build the py distribution, py deps and custom (lean4) installs) +cd $HOME/PyPantograph +poetry build + +# install pypantograph in editable mode (only pyproject.toml needed! Assuming your at the proj root) +pip install -e . + +# confirm intalls +pip list | grep pantograph +pip list | grep vllm +pip list | greo torch + +# make sure the PyPantrograph server tests by Leni work +python -m server.py +``` diff --git a/pyproject.toml b/pyproject.toml index 1450528..2444e94 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,8 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.11" pexpect = "^4.9.0" +torch = "2.2.1" +vllm = "0.4.1" [tool.poetry.build] generate-setup-file = false