Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytest test #84

Merged
merged 7 commits into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
python-version: '3.x'
ref: ${{ github.head_ref }}

- name: Install dependencies
Expand Down
5 changes: 4 additions & 1 deletion requirements_git_actions.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
black==23.9.1
black[jupyter]
pytest==7.4.3
pytest==7.4.3
torch==2.1.0
transformers==4.34.1
scikit-learn==1.3.1
5 changes: 0 additions & 5 deletions tests/test_embedding_similarity.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import torch
import sys
import os
'''current = os.path.dirname(os.path.realpath('tokenization_n_embedding.py'))
parent = os.path.dirname(current)
sys.path.append(parent)
print(sys.path)'''
from src.backend.api.tokenization_n_embedding import tokenize_text, generate_embeddings
from src.backend.api.matching_algorithm import get_free_text_match

Expand All @@ -19,7 +15,6 @@ def test_generate_embeddings():
assert len(generate_embeddings("any text")) == 1
assert len(generate_embeddings("any text")[0]) == 768
assert generate_embeddings("").dtype == torch.float32
assert generate_embeddings("")[0][0].item()==-0.00922924280166626

def test_get_free_text_match_text():
assert get_free_text_match(
Expand Down