-
Notifications
You must be signed in to change notification settings - Fork 6
Feat/nnlm model implementation #3
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
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request introduces several changes to the project, focusing on the configuration of workflows, dependencies, and the implementation of a Neural Network Language Model (NNLM). Key modifications include updating the GitHub Actions workflows for testing and documentation, reducing supported Python versions, and adding new dependencies for machine learning libraries. Additionally, a new NNLM class and tokenizer management functionalities have been implemented, enhancing the project's capabilities in natural language processing. Changes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (16)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
🧹 Nitpick comments (1)
toynlp/nnlm/model.py (1)
41-54: Move test code to proper test file.The test code in
__main__block should be moved to a proper test file with comprehensive test cases.Create a new file
tests/test_nnlm.pywith proper test cases:import pytest import torch from toynlp.nnlm.model import NNLM def test_nnlm_initialization(): model = NNLM(seq_len=6, vocab_size=1000, embedding_dim=100, hidden_dim=60) assert isinstance(model, NNLM) def test_nnlm_forward(): model = NNLM(seq_len=6, vocab_size=1000) tokens = torch.randint(0, 1000, (2, 5)) output = model(tokens) assert output.shape == (2, 1000) assert torch.allclose(output.sum(dim=-1), torch.ones(2)) def test_nnlm_invalid_input(): model = NNLM() with pytest.raises(ValueError): model(torch.randint(0, 1000, (2, 2, 5))) # 3D input
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (7)
.github/workflows/test.yaml(1 hunks).python-version(1 hunks)pyproject.toml(2 hunks)toynlp/hello.py(0 hunks)toynlp/nnlm/README.md(1 hunks)toynlp/nnlm/model.py(1 hunks)toynlp/nnlm/train.py(1 hunks)
💤 Files with no reviewable changes (1)
- toynlp/hello.py
✅ Files skipped from review due to trivial changes (2)
- .python-version
- toynlp/nnlm/README.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: ci (3.13, windows-latest)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3 +/- ##
============================================
- Coverage 100.00% 47.96% -52.04%
============================================
Files 1 6 +5
Lines 2 221 +219
============================================
+ Hits 2 106 +104
- Misses 0 115 +115 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
Release Notes
New Features
Dependencies
Documentation
Chores
.gitignoreto exclude model artifacts and logging files.Removals
hello()function and associated test file from the project.