-
Notifications
You must be signed in to change notification settings - Fork 92
tests: Add distill tests and CI #42
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
Merged
Merged
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f8cf037
Fixed failing test
Pringled 10d7908
Fixed merge conflicts
Pringled d0dcb10
Added tests for distillation, added tokenizer for testing
Pringled b3f9969
Removed imports
Pringled d867fe9
Added extra test
Pringled f4bbe28
Updated test
Pringled 7c0510e
Merge branch 'main' of https://github.com/MinishLab/model2vec into ad…
Pringled 8ac61b8
Updated test
Pringled af00d5d
Small update
Pringled 6ce5774
Updated init
Pringled 01db9b5
Added CI for codeconv
Pringled 7a45957
Added CI for codeconv
Pringled 96d23cc
Added CI for codeconv
Pringled ab16ad7
Added CI for codeconv
Pringled 8fd2e3d
Added CI for codeconv
Pringled f5aeeac
Added CI for codeconv
Pringled f6ed595
Added CI for codeconv
Pringled a97b65e
Added CI for codeconv
Pringled 72b23a2
Added CI for codeconv
Pringled be3412b
Added CI for codeconv
Pringled 5add902
Resolved comments
Pringled File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Run tests and upload coverage | ||
|
||
on: | ||
push | ||
|
||
jobs: | ||
test: | ||
name: Run tests with pytest | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | ||
python-version: ["3.10"] | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
allow-prereleases: true | ||
|
||
# Step for Windows: Create and activate a virtual environment | ||
- name: Create and activate a virtual environment (Windows) | ||
if: ${{ runner.os == 'Windows' }} | ||
run: | | ||
irm https://astral.sh/uv/install.ps1 | iex | ||
uv venv .venv | ||
"VIRTUAL_ENV=.venv" | Out-File -FilePath $env:GITHUB_ENV -Append | ||
"$PWD/.venv/Scripts" | Out-File -FilePath $env:GITHUB_PATH -Append | ||
|
||
# Step for Unix: Create and activate a virtual environment | ||
- name: Create and activate a virtual environment (Unix) | ||
if: ${{ runner.os != 'Windows' }} | ||
run: | | ||
curl -LsSf https://astral.sh/uv/install.sh | sh | ||
uv venv .venv | ||
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV | ||
echo "$PWD/.venv/bin" >> $GITHUB_PATH | ||
|
||
# Install dependencies using uv pip | ||
- name: Install dependencies | ||
run: make install | ||
# run: uv pip install -e ".[pytest]" | ||
|
||
# Run tests with coverage | ||
- name: Run tests under coverage | ||
run: | | ||
coverage run -m pytest | ||
coverage report | ||
|
||
# Upload results to Codecov | ||
- name: Upload results to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"cls_token": "[CLS]", | ||
"mask_token": "[MASK]", | ||
"pad_token": "[PAD]", | ||
"sep_token": "[SEP]", | ||
"unk_token": "[UNK]" | ||
} |
Oops, something went wrong.
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.
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.
One cool addition could be to either make the configurable, or make the seed of the rand depend on the input data. This makes tests a lot more reproducible and predictable. Anyway, just a small thing.
Something like an MD5 hash of the input_ids as a tuple, or maybe just the sum? Idk