commit 86cd47f4ccb07ef38164ed70d972364c802280df
parent dcf3ee48620f3a513161b14b1781b317f8fe8a83
Author: Sondre Wold <sondrewold1@gmail.com>
Date: Thu, 25 Sep 2025 09:51:51 +0200
cleanup unused code i models.py and unused stuff from gitignore
Diffstat:
| M | .gitignore | | | 78 | ------------------------------------------------------------------------------ |
| M | models.py | | | 14 | +++----------- |
2 files changed, 3 insertions(+), 89 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -53,33 +53,10 @@ coverage.xml
.pytest_cache/
cover/
-# Translations
-*.mo
-*.pot
-
-# Django stuff:
-*.log
-local_settings.py
-db.sqlite3
-db.sqlite3-journal
-
-# Flask stuff:
-instance/
-.webassets-cache
-
-# Scrapy stuff:
-.scrapy
-
-# Sphinx documentation
-docs/_build/
-
# PyBuilder
.pybuilder/
target/
-# Jupyter Notebook
-.ipynb_checkpoints
-
# IPython
profile_default/
ipython_config.py
@@ -96,12 +73,6 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock
-# UV
-# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
-# This is especially recommended for binary packages to ensure reproducibility, and is more
-# commonly ignored for libraries.
-#uv.lock
-
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
@@ -119,23 +90,9 @@ ipython_config.py
.pdm-python
.pdm-build/
-# pixi
-# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
-#pixi.lock
-# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
-# in the .venv directory. It is recommended not to include this directory in version control.
-.pixi
-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
-# Celery stuff
-celerybeat-schedule
-celerybeat.pid
-
-# SageMath parsed files
-*.sage.py
-
# Environments
.env
.envrc
@@ -170,43 +127,8 @@ dmypy.json
# Cython debug symbols
cython_debug/
-# PyCharm
-# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
-# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
-# and can be added to the global gitignore or merged into this file. For a more nuclear
-# option (not recommended) you can uncomment the following to ignore the entire idea folder.
-#.idea/
-
-# Abstra
-# Abstra is an AI-powered process automation framework.
-# Ignore directories containing user credentials, local state, and settings.
-# Learn more at https://abstra.io/docs
-.abstra/
-
-# Visual Studio Code
-# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
-# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
-# and can be added to the global gitignore or merged into this file. However, if you prefer,
-# you could uncomment the following to ignore the entire vscode folder
-# .vscode/
-
# Ruff stuff:
.ruff_cache/
# PyPI configuration file
.pypirc
-
-# Cursor
-# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
-# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
-# refer to https://docs.cursor.com/context/ignore-files
-.cursorignore
-.cursorindexingignore
-
-# Marimo
-marimo/_static/
-marimo/_lsp/
-__marimo__/
-
-# Streamlit
-.streamlit/secrets.toml
diff --git a/models.py b/models.py
@@ -15,14 +15,6 @@ class Model(ABC):
def embed(self, string: str) -> torch.Tensor:
pass
- def normalize(
- self,
- composed: torch.Tensor,
- original_phrase_removed: torch.Tensor,
- lambda_value: float,
- ):
- return composed - (original_phrase_removed * lambda_value)
-
@abstractmethod
def calculate_similarity(self, a: torch.Tensor, b: torch.Tensor) -> float:
pass
@@ -44,7 +36,7 @@ class ModelFactory:
return cls._factory[name](*args, **kwargs)
-# Generated
+# Generated using Mistral
def mean_pool_last_four_layers(string: str, tokenizer, encoder) -> torch.Tensor:
inputs = tokenizer(string.lower(), return_tensors="pt")
@@ -88,7 +80,7 @@ def mean_pool_last_four_layers(string: str, tokenizer, encoder) -> torch.Tensor:
return mean_pooled
-# Generated
+# Generated using Mistral
def mean_pool(string: str, tokenizer, encoder) -> torch.Tensor:
inputs = tokenizer(string.lower(), return_tensors="pt")
outputs = encoder(**inputs)
@@ -118,7 +110,7 @@ def mean_pool(string: str, tokenizer, encoder) -> torch.Tensor:
return mean_pooled
-# Generated
+# Generated using Mistral
def cls_sep_pool(string: str, tokenizer, encoder) -> torch.Tensor:
inputs = tokenizer(string.lower(), return_tensors="pt")
outputs = encoder(**inputs)