-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from kajyuuen/renewal
Add Marginal CRF
- Loading branch information
Showing
20 changed files
with
649 additions
and
46 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,32 @@ | ||
name: pytest | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
pytest: | ||
name: Run tests with pytest | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python | ||
- name: Add path for Poetry | ||
run: echo "$HOME/.poetry/bin" >> $GITHUB_PATH | ||
- name: Install Dependencies | ||
run: poetry install --no-interaction | ||
- name: Run Tests | ||
run: poetry run pytest |
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,66 @@ | ||
name: release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Next Version" | ||
required: true | ||
default: "x.y.z" | ||
release_note: | ||
description: "release note" | ||
required: false | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -O | ||
python install-poetry.py --preview --version 1.2.0a1 | ||
- name: Add path for Poetry | ||
run: echo "$HOME/.poetry/bin" >> $GITHUB_PATH | ||
- name: Add Poetry Plugin | ||
run: | | ||
pip install poetry-version-plugin | ||
- name: PyPI Settings | ||
run: | | ||
poetry config pypi-token.pypi ${{secrets.PYPI_TOKEN}} | ||
- name: Build Poetry | ||
run: | | ||
git tag v${{ github.event.inputs.version }} | ||
poetry build | ||
poetry publish | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ github.event.inputs.version }} | ||
release_name: Release v${{ github.event.inputs.version }} | ||
body: | | ||
${{ github.event.inputs.release_note }} | ||
draft: false | ||
prerelease: false | ||
- name: Get Name of Artifact | ||
run: | | ||
ARTIFACT_PATHNAME=$(ls dist/*.whl | head -n 1) | ||
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME) | ||
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV | ||
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV | ||
- name: Upload Whl to Release Assets | ||
id: upload-release-asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{ env.ARTIFACT_PATHNAME }} | ||
asset_name: ${{ env.ARTIFACT_NAME }} | ||
asset_content_type: application/x-wheel+zip |
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 |
---|---|---|
|
@@ -6,4 +6,5 @@ pytorch_partial_crf.egg-info | |
.vscode | ||
.cache | ||
docs/_build/ | ||
.venv | ||
.venv | ||
.pytest_cache |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[tool.poetry] | ||
name = "pytorch-partial-crf" | ||
version = "0.2.0" | ||
description = "" | ||
authors = ["Koga Kobayashi"] | ||
license = "MIT" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
pytest = "^6.2.5" | ||
torch = "^1.10.0" | ||
|
||
[tool.poetry.dev-dependencies] | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" |
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,4 +1,3 @@ | ||
__version__ = '0.1.2' | ||
|
||
from pytorch_partial_crf.marginal_crf import MarginalCRF | ||
from pytorch_partial_crf.partial_crf import PartialCRF | ||
from pytorch_partial_crf.crf import CRF |
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
Oops, something went wrong.