Skip to content

Commit

Permalink
[AIC-PY] + publish script for any pypi pkg, small mods to llama ext
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanlastmileai committed Nov 17, 2023
1 parent ee54195 commit 70d8fe2
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extensions/llama/python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
AIConfig Model Parser for LLama cpp (Python bindings).

Usage: See cookbook:

https://github.com/lastmile-ai/aiconfig/blob/c64224ed48ccb7f8cbd2d3a1b2e8bd250aeb9ff2/cookbooks/llama/python/ask_llama.py#L4
43 changes: 43 additions & 0 deletions extensions/llama/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[build-system]
requires = ["setuptools", "wheel"]

[project]
name = "python-aiconfig-llama"
version = "0.0.1"
authors = [
{ name="Jonathan Lessinger", email="[email protected]" },
]
description = "LLama extension for AIConfig Library"
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
]
dynamic = ["dependencies"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[project.urls]
"Homepage" = "https://github.com/lastmile-ai/aiconfig"
"Bug Tracker" = "https://github.com/lastmile-ai/aiconfig/issues"

# Black formatting
[tool.black]
line-length = 99
include = '\.pyi?$'
exclude = '''
/(
.eggs # exclude a few common directories in the
| .git # root of the project
| .hg
| .mypy_cache
| .tox
| venv
| _build
| buck-out
| build
| dist
)/
'''
37 changes: 37 additions & 0 deletions scripts/pypipublish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#! /bin/zsh
# pypipublish.sh
# Usage: Run ./scripts/pypipublish.sh path/to/project/root conda-env-name
# path/to/project/root is anywhere with a pyproject.toml.

# NOTE: This assumes you have the aiconfig conda environment created.
# You will be prompted for a username and password. For the username, use __token__.
# For the password, use the token value, including the pypi- prefix.
# To get a PyPi token, go here:
# Need to get a token from here (scroll down to API Tokens): https://pypi.org/manage/account/
# If you have issues, read the docs: https://packaging.python.org/en/latest/tutorials/packaging-projects/

# If you want to upload to testpypi, run pypipublish-test.sh.

if [ -z "$2" ]
then
echo "Usage: pypipublish.sh path/to/project/root conda-env-name"
exit 1
fi


cd "$1"
if [ ! -f "pyproject.toml" ]
then
echo "File pyproject.toml does not exist in the current directory"
exit 1
fi

rm -rf ./dist

source /opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh && conda activate "$2"\
&& python3 -m pip install --upgrade build \
&& python3 -m build \
&& python3 -m pip install --upgrade twine \
&& python3 -m twine upload dist/*

cd -

0 comments on commit 70d8fe2

Please sign in to comment.