Refactor project metadata, add tests, add type-hints, lint/format #43
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.
Hello @lucidrains,
I use this repo a lot and want to start modifying some things (e.g. adding xpos to axial; and mess around with YaRN). I wanted to tidy up the project a bit, use the new
pyproject.toml
project metadata, and adduv
for dev env and dependency management. I also added a few basic tests to verify basic functionality.Did some linting and formatting with
ruff
as well. Right now no rules are enforced, but tidied up the codebase a bit.Also found 1 minor bug in the code and fixed it. b98c5d7
Also fixed an edge case (should never happen who would do 2 embedding dim size anyways, but): 65a0e81
The tests manually calculate RoPE and apply it to randomly generated embedding vectors and asserts if the library is doing it correctly. There is still a lot of room for testing but I don't think they're that crucial, mostly API stuff. However, would be nice to test XPOS and the other stuff I want to add in the future, so I set up a test harness with pytest for now and can get test coverage.
Let me know what you think, and of course open to modifications!
Cheers