From 1d2341c5b9bf4df95bd6513acb21516a3d5f45fc Mon Sep 17 00:00:00 2001 From: Kenneth Enevoldsen Date: Thu, 7 Dec 2023 11:52:12 +0100 Subject: [PATCH] fix: ran ruff formatter --- docs/getting_started.ipynb | 3 ++- makefile | 4 +--- src/seb/seb_models/hf_models.py | 12 +++++++++--- tests/test_all_models.py | 2 +- tests/test_benchmark.py | 4 ++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/docs/getting_started.ipynb b/docs/getting_started.ipynb index d9324a2b..35eb2ca5 100644 --- a/docs/getting_started.ipynb +++ b/docs/getting_started.ipynb @@ -71,7 +71,7 @@ } ], "source": [ - "benchmark_result[0] # examine the results for the first task" + "benchmark_result[0] # examine the results for the first task" ] }, { @@ -93,6 +93,7 @@ "\n", "model_name = \"sentence-transformers/all-MiniLM-L12-v2\"\n", "\n", + "\n", "def get_my_model():\n", " from sentence_transformers import SentenceTransformer\n", "\n", diff --git a/makefile b/makefile index aa67b295..e171ca85 100644 --- a/makefile +++ b/makefile @@ -9,9 +9,7 @@ static-type-check: lint: @echo "--- 🧹 Running linters ---" ruff format . # running ruff formatting - ruff src/ --fix # running ruff linting - ruff tests/ --fix - ruff docs/conf.py --fix + ruff **/*.py --fix # running ruff linting test: @echo "--- 🧪 Running tests ---" diff --git a/src/seb/seb_models/hf_models.py b/src/seb/seb_models/hf_models.py index 04c959d8..7ba9797c 100644 --- a/src/seb/seb_models/hf_models.py +++ b/src/seb/seb_models/hf_models.py @@ -121,7 +121,9 @@ def create_dansk_bert() -> SebModel: return SebModel( # see https://huggingface.co/vesteinn/DanskBERT/discussions/3 - loader=partial(get_sentence_transformer, model_name=hf_name, max_seq_length=512), # type: ignore + loader=partial( + get_sentence_transformer, model_name=hf_name, max_seq_length=512 + ), # type: ignore meta=meta, ) @@ -221,7 +223,9 @@ def create_bert_base_swedish_cased() -> SebModel: open_source=True, ) return SebModel( - loader=partial(get_sentence_transformer, model_name=hf_name, max_seq_length=512), # type: ignore + loader=partial( + get_sentence_transformer, model_name=hf_name, max_seq_length=512 + ), # type: ignore meta=meta, ) @@ -254,7 +258,9 @@ def create_xlm_roberta_base() -> SebModel: ) return SebModel( - loader=partial(get_sentence_transformer, model_name=hf_name, max_seq_length=512), # type: ignore + loader=partial( + get_sentence_transformer, model_name=hf_name, max_seq_length=512 + ), # type: ignore meta=meta, ) diff --git a/tests/test_all_models.py b/tests/test_all_models.py index 1e613f0a..31abff92 100644 --- a/tests/test_all_models.py +++ b/tests/test_all_models.py @@ -5,7 +5,7 @@ import pytest import seb -from .dummy_task import create_test_encode_task # noqa: F401 +from .dummy_task import create_test_encode_task all_models = seb.get_all_models() openai_models = [] diff --git a/tests/test_benchmark.py b/tests/test_benchmark.py index 492ac45e..822de9bc 100644 --- a/tests/test_benchmark.py +++ b/tests/test_benchmark.py @@ -10,8 +10,8 @@ import pytest import seb -from .dummy_model import create_test_model # noqa: F401 -from .dummy_task import create_test_task # noqa: F401 +from .dummy_model import create_test_model +from .dummy_task import create_test_task from .test_tasks import all_tasks_names