Skip to content

Commit

Permalink
pypi stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed May 25, 2023
1 parent 66f38c8 commit 1702afe
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 2 additions & 0 deletions Andromeda/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from Andromeda.traingv2 import TrainAndromeda
from Andromeda.build_dataset import built_dataset
4 changes: 2 additions & 2 deletions build_dataset.py → Andromeda/build_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CFG:
TOKENIZER: str = "EleutherAI/gpt-neox-20b"
DATASET_NAME: str = "EleutherAI/the_pile_deduplicated"

def main(args):
def built_dataset(args):
tokenizer = AutoTokenizer.from_pretrained(CFG.Tokenizer)
train_dataset = load_dataset(CFG.DATASET_NAME, split="train")

Expand Down Expand Up @@ -67,4 +67,4 @@ def group_texts(examples):
parser.add_argument("--tokenizer", type=str, default=CFG.TOKENIZER, help="Tokenizer model to use")
parser.add_argument("--dataset_name", type=str, default=CFG.DATASET_NAME, help="Name of the dataset to process")
args = parser.parse_args()
main(args)
built_dataset(args)
File renamed without changes.
4 changes: 2 additions & 2 deletions traingv2.py → Andromeda/traingv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def group_texts(examples):
# main


def main():
def TrainAndromeda():
# accelerator

timeout = InitProcessGroupKwargs(timeout=timedelta(seconds=1_000_000))
Expand Down Expand Up @@ -431,4 +431,4 @@ def main():


if __name__ == "__main__":
main()
TrainAndromeda()
4 changes: 2 additions & 2 deletions training.py → Andromeda/training.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@


from lion_pytorch import Lion
from x_transformers import TransformerWrapper, Decoder, AutoregressiveWrapper

# from x_transformers import TransformerWrapper, Decoder, AutoregressiveWrapper
from optimus_prim import TransformerWrapper, Decoder, AutoregressiveWrapper

from torch.nn.parallel import DataParallel, DistributedDataParallel
import torch.distributed as dist
Expand Down
34 changes: 34 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from setuptools import setup, find_packages

setup(
name = 'andromeda',
packages = find_packages(exclude=['examples']),
version = '1.1.3',
license='MIT',
description = 'andromeda - Pytorch',
author = 'Kye Gomez',
author_email = '[email protected]',
url = 'https://github.com/kyegomez/Andromeda',
long_description_content_type = 'text/markdown',
keywords = [
'artificial intelligence',
'attention mechanism',
'transformers'
],
install_requires=[
'torch>=1.6',
'einops>=0.6.1',
'datasets',
'accelerate',
'transformers',
'optimus-prime-transformers',
'lion_pytorch'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
],
)

0 comments on commit 1702afe

Please sign in to comment.