-
Notifications
You must be signed in to change notification settings - Fork 53
feat: Conda/Mamba-based installation script #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+96
−2
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4057bd6
feat: conda or mamba-based installation script
guicho271828 f9669f4
docs: conda-based installation script
guicho271828 9fd5a61
fix: reflect README
guicho271828 d781b48
feat: getopts for -h option
guicho271828 43c7ae2
feat: detects an existing mellea environment and try to remove it
guicho271828 c224400
feat: added -y option
guicho271828 a091854
fix: enforce VLLM_USE_V1 = 0
guicho271828 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,7 +111,7 @@ uv run --with mellea docs/examples/tutorial/example.py | |
| | MCP | <a target="_blank" rel="noopener noreferrer" href="https://colab.research.google.com/github/generative-computing/mellea/blob/main/docs/examples/notebooks/mcp_example.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> | Mellea + MCP | | ||
|
|
||
|
|
||
| ### Installing from source | ||
| ### `uv`-based installation from source | ||
|
|
||
| Fork and clone the repositoy: | ||
|
|
||
|
|
@@ -137,7 +137,7 @@ If you are planning to contribute to the repo, it would be good to have all the | |
| uv pip install '.[all]' --group dev --group notebook --group docs | ||
| ``` | ||
|
|
||
| or | ||
| or | ||
|
|
||
| ```bash | ||
| uv sync --all-extras --all-groups | ||
|
|
@@ -149,6 +149,20 @@ If you want to contribute, ensure that you install the precommit hooks: | |
| pre-commit install | ||
| ``` | ||
|
|
||
| ### `conda`/`mamba`-based installation from source | ||
|
|
||
| Fork and clone the repositoy: | ||
|
|
||
| ```bash | ||
| git clone ssh://[email protected]/<my-username>/mellea.git && cd mellea/ | ||
| ``` | ||
|
|
||
| It comes with an installation script, which does all the commands listed above: | ||
|
|
||
| ```bash | ||
| conda/install.sh | ||
| ``` | ||
|
|
||
| ## Getting started with validation | ||
|
|
||
| Mellea supports validation of generation results through a **instruct-validate-repair** pattern. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| name: mellea | ||
| channels: | ||
| - conda-forge | ||
| dependencies: | ||
| - python=3.12 # note: at the time of writing, xformer (< vllm) has a broken wheel for 3.13. https://github.com/facebookresearch/xformers/issues/740#issuecomment-2753869337 | ||
| - uv | ||
| variables: | ||
| VLLM_USE_V1: 0 # need this to make outlines work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| CONDA="" | ||
| if which mamba > /dev/null | ||
| then | ||
| CONDA=$(which mamba) | ||
| fi | ||
| if which conda > /dev/null | ||
| then | ||
| CONDA=$(which conda) | ||
| fi | ||
|
|
||
| if [ -z $CONDA ] | ||
| then | ||
| echo "Error: conda or mamba is not installed or is not in the PATH." | ||
| echo "Go to " | ||
| echo "* https://github.com/conda-forge/miniforge (open source)" | ||
| echo "* https://www.anaconda.com/download/success (registration required)" | ||
| echo "to obtain a conda/mamba installer." | ||
| else | ||
| echo "Using $CONDA for environment setup" | ||
| fi | ||
|
|
||
|
|
||
| usage(){ | ||
| echo "Usage: install.sh [-h] [-y]" | ||
| echo | ||
| echo "-h : show this help" | ||
| echo "-y : Adds '-y' option to '$CONDA env [create|remove|...]' command arguments." | ||
| exit 1 | ||
| } | ||
|
|
||
| CONDA_OPTIONS="" | ||
| while getopts "yh" OPTNAME ; do | ||
| case "${OPTNAME}" in | ||
| h) | ||
| usage | ||
| ;; | ||
| y) | ||
| CONDA_OPTIONS="-y" | ||
| shift 1 | ||
| ;; | ||
| :) | ||
| # If expected argument omitted: | ||
| echo "Error: -${OPTARG} requires an argument." | ||
| exit 1 | ||
| ;; | ||
| *) | ||
| # If unknown (any other) option: | ||
| echo "Error: -${OPTARG} unknown." | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| if $CONDA env list | grep -q mellea | ||
| then | ||
| echo "An existing mellea environment was found." | ||
| $CONDA env remove $CONDA_OPTIONS -n mellea | ||
| fi | ||
guicho271828 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| # note: | ||
| # this is a portable way (works in linux and osx) to get the directory of this script. | ||
| # readlink -ef may not work on osx. | ||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
| $CONDA env create $CONDA_OPTIONS -f $SCRIPT_DIR/environment.yml | ||
|
|
||
| $CONDA run -n mellea uv pip install -e .[all] --group dev --group notebook --group docs | ||
|
|
||
| $CONDA run -n mellea pre-commit install | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we are forcing them to fork it? It might be easier to just have them install from our github?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops didnt notice it before merging.