-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* support caching of metadata * upd version * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add tests for switchencoderandhead * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Upd version * `poetry lock` versins Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: M. Yusuf Sarıgöz <[email protected]>
- Loading branch information
1 parent
760020a
commit f2be2a4
Showing
12 changed files
with
378 additions
and
518 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "quaterion" | ||
version = "0.1.30" | ||
version = "0.1.31" | ||
description = "Similarity Learning fine-tuning framework" | ||
authors = ["Quaterion Authors <[email protected]>"] | ||
packages = [ | ||
|
@@ -16,7 +16,7 @@ keywords = ["framework", "similarity-learning", "metric-learning", "similarity", | |
python = ">=3.8,<3.11" | ||
torch = ">=1.8.2" | ||
pytorch-lightning = "^1.6.4" | ||
quaterion-models = "^0.1.16" | ||
quaterion-models = "0.1.17" | ||
loguru = "^0.5.3" | ||
mmh3 = "^3.0.0" | ||
pytorch-metric-learning = {version = "^1.3.0", optional = true} | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pytorch_lightning as pl | ||
|
||
from quaterion import Quaterion | ||
from quaterion.dataset import PairsSimilarityDataLoader | ||
|
||
from .model_fixtures import FakePairDataset, FakeTrainableModelWithSwitchEncoder | ||
|
||
|
||
class TestSwitchEncoder: | ||
def test_switch_encoder_and_head(self): | ||
model = FakeTrainableModelWithSwitchEncoder() | ||
dataset = FakePairDataset() | ||
data_loader = PairsSimilarityDataLoader(dataset, batch_size=3) | ||
trainer_args = Quaterion.trainer_defaults(model, data_loader) | ||
trainer_args["callbacks"].pop(1) # remove EarlyStopping callback | ||
trainer_args["accelerator"] = "cpu" | ||
trainer_args["max_epochs"] = 1 | ||
Quaterion.fit( | ||
trainable_model=model, | ||
trainer=pl.Trainer(**trainer_args), | ||
train_dataloader=data_loader, | ||
) |