import unittest from unittest import TestCase from semantic_search import SemanticSearch import torch from typing import NoReturn import gc class SemanticSearchTest(TestCase): def setUp(self) -> NoReturn: self.searching_engine = SemanticSearch() def test_search(self, query: str = 'Как правильно заполнять счёт-фактуру?') -> NoReturn: self.searching_engine.search(query) def tearDown(self) -> NoReturn: del self.searching_engine torch.cuda.empty_cache() gc.collect() if __name__ == '__main__': unittest.main()