-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8775b7a
commit 54085dc
Showing
28 changed files
with
734 additions
and
670 deletions.
There are no files selected for viewing
This file contains 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,53 @@ | ||
name: Python Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ".[dev]" | ||
- name: Run tests | ||
run: | | ||
pytest giga_cherche --cov=giga_cherche --cov-report=html --cov-report=xml | ||
- name: Upload coverage report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-report | ||
path: htmlcov | ||
|
||
- name: Post coverage comment | ||
if: success() | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const fs = require('fs'); | ||
const coverage = fs.readFileSync('coverage.xml', 'utf8'); | ||
const totalCoverage = parseFloat(coverage.match(/line-rate="([\d.]+)"/)[1]) * 100; | ||
const commentBody = `### Coverage Report\n\n- Total coverage: ${totalCoverage.toFixed(2)}%`; | ||
const { context, getOctokit } = require('@actions/github'); | ||
const issue_number = context.payload.pull_request.number; | ||
await getOctokit(process.env.GITHUB_TOKEN).rest.issues.createComment({ | ||
...context.repo, | ||
issue_number, | ||
body: commentBody, | ||
}); |
This file contains 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 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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
__all__ = [ | ||
"models", | ||
"losses", | ||
"scores", | ||
"evaluation", | ||
"indexes", | ||
"reranker", | ||
"data_collator", | ||
"losses", | ||
"models", | ||
"rerank", | ||
"retrieve", | ||
"scores", | ||
"utils", | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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 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 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .colbert import ColBERTLossv1, ColBERTLossv2 | ||
from .contrastive import Contrastive | ||
from .distillation import Distillation | ||
|
||
__all__ = ["ColBERTLossv1", "ColBERTLossv2"] | ||
__all__ = ["Contrastive", "Distillation"] |
Oops, something went wrong.