8000 Developer setup by Stonelinks · Pull Request #135 · abetlen/llama-cpp-python · GitHub
[go: up one dir, main page]

Skip to content

Developer setup #135

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
merged 3 commits into from
May 26, 2023
Merged

Developer setup #135

merged 3 commits into from
May 26, 2023

Conversation

Stonelinks
Copy link
Contributor

I have no idea if my setup is right, the README says "install the package in development mode" but just provides instructions to clone the repo, init submodules, then call setup.py (which will fail because skbuild isn't installed) to compile llama.cpp.

I'm left wondering how to actually set up this project for development. After random stuff breaking / conflicting with my system, I made a stab at making this more explicit with poetry & a virtualenv.

Feedback always welcome

@Stonelinks Stonelinks changed the title Setup Developer setup May 1, 2023
@Stonelinks
Copy link
Contributor Author

hmmmm there might be a problem with this, i assumed poetry install --all-extras would pickup setup.py's server extra and install fastapi but that doesn't seem to be the case:

(llama-cpp-python-py3.10) humbaba:llama-cpp-python lucas.doyle$ MODEL=./vendor/llama.cpp/models/ggml-vocab.bin VOCAB_ONLY=true python3 -m llama_cpp.server
Traceback (most recent call last):
  File "/Users/lucas.doyle/.pyenv/versions/3.10.11/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/lucas.doyle/.pyenv/versions/3.10.11/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/lucas.doyle/Dropbox/workspace/llama-cpp-python/llama_cpp/server/__main__.py", line 22, in <module>
    from fastapi import Depends, FastAPI
ModuleNotFoundError: No module named 'fastapi'

Maybe direct people to use pip instead?

@Stonelinks
Copy link
Contributor Author

i guess poetry extras and setup.py extras are two different things, poetry seems to maintain them in pyproject.toml: https://python-poetry.org/docs/pyproject/#extras

solution: going to add a section for the server there too i guess, meanwhile will give people the option of using pip

@Stonelinks
Copy link
Contributor Author

fixed up the last commit to handle pip and / or poetry

@snxraven
Copy link
snxraven commented May 2, 2023

@Stonelinks thanks for this, I have been battling this and installing things manually

Stonelinks added 3 commits May 9, 2023 16:03
The README says to run `python3 setup.py develop` to build the library, however on a blank install this fails because scikit-build is not installed. This adds it to the dev dependencies so that it is installed.
Its cleaner to keep the virtualenv in the project directory, and
poetry makes it easy to do that via this config.
Give folks options + explicit instructions for installing with poetry or pip.
@gjmulder gjmulder added the enhancement New feature or request label May 23, 2023
@abetlen abetlen merged commit 447a3d2 into abetlen:main May 26, 2023
@abetlen
Copy link
Owner
abetlen commented May 26, 2023

@Stonelinks thanks for the contribution, sorry this took so long to merge, appreciate the hard work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0