Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Add poetry packaging #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Aleksandar1932
Copy link

Description

This PR is focused on the TODO note: Add pip installer with PyPI. With the enablement of packaging with poetry. The dependencies are added in pyproject.toml along with the project description, the author's email has to be added afterward.

Testing Steps

  1. Clone the repo
  2. Install poetry. See official guide
  3. Navigate to the directory
  4. Install the dependencies poetry install
  5. Activate the virtual environment poetry shell
  6. Try:
from lamda_pytorch.lamda_pytorch import LaMDA
from lamda_pytorch.utils.utils import AutoregressiveWrapper
import torch

if __name__ == "__main__":
    lamda_base = LaMDA(
        num_tokens = 20000,
        dim = 512,
        dim_head = 64,
        depth = 12,
        heads = 8
    )

    lamda = AutoregressiveWrapper(lamda_base, max_seq_len = 512)

    tokens = torch.randint(0, 20000, (1, 512)) # mock token data

    logits = lamda(tokens)

    print(logits)

Publishing

Poetry supports publishing to PyPi the packaged library, for that follow the official guide.

  1. Build your library poetry build
  2. Publish it poetry publish

@conceptofmind
Copy link
Owner

conceptofmind commented Jul 5, 2022

Hi @Aleksandar1932 ,

I was just looking into Poetry for package management the other day, so this pull request comes at the perfect time. I have previously used Twine and setup tools.

I will further review the Poetry documentation over the week and then merge your Pull Request.

Thank you,

Enrico

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants