From cfd484480046ff2bd040ca740dad898381f626bb Mon Sep 17 00:00:00 2001 From: Alberto Cetoli Date: Sun, 15 Dec 2024 13:03:37 +0000 Subject: [PATCH] removed extractors --- setup.py | 1 - tests/test_connection.py | 6 +++--- tests/test_entailer.py | 2 +- wafl/extractors/__init__.py | 1 - wafl/extractors/utils.py | 23 ----------------------- wafl/variables.py | 4 ++-- 6 files changed, 6 insertions(+), 31 deletions(-) delete mode 100644 wafl/extractors/__init__.py delete mode 100644 wafl/extractors/utils.py diff --git a/setup.py b/setup.py index 1cf54b54..c926112f 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,6 @@ "wafl.connectors.remote", "wafl.data_objects", "wafl.events", - "wafl.extractors", "wafl.handlers", "wafl.inference", "wafl.interface", diff --git a/tests/test_connection.py b/tests/test_connection.py index 317a91fd..112a34c3 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -12,7 +12,7 @@ class TestConnection(TestCase): def test__connection_to_generative_model_can_generate_text(self): config = Configuration.load_local_config() - connector = RemoteLLMConnector(config.get_value("llm_model")) + connector = RemoteLLMConnector(config) prediction = asyncio.run( connector.predict( PromptCreator.create_from_one_instruction( @@ -25,7 +25,7 @@ def test__connection_to_generative_model_can_generate_text(self): def test__connection_to_generative_model_can_generate_text_within_tags(self): config = Configuration.load_local_config() - connector = RemoteLLMConnector(config.get_value("llm_model")) + connector = RemoteLLMConnector(config) connector._num_prediction_tokens = 200 text = 'Generate a full paragraph based on this chapter title " The First Contact". The theme of the paragraph is space opera. Include the characters "Alberto" and "Maria". Write at least three sentences.' prompt = f""" @@ -43,7 +43,7 @@ def test__connection_to_generative_model_can_generate_text_within_tags(self): def test__connection_to_generative_model_can_generate_a_python_list(self): config = Configuration.load_local_config() - connector = RemoteLLMConnector(config.get_value("llm_model")) + connector = RemoteLLMConnector(config) connector._num_prediction_tokens = 200 prompt = "Generate a Python list of 4 chapters names for a space opera book. The output needs to be a python list of strings: " prediction = asyncio.run( diff --git a/tests/test_entailer.py b/tests/test_entailer.py index c1b5a451..6ccc7088 100644 --- a/tests/test_entailer.py +++ b/tests/test_entailer.py @@ -12,7 +12,7 @@ class TestConnection(TestCase): def test__entailer_connector(self): config = Configuration.load_local_config() - connector = RemoteEntailerConnector(config.get_value("entailer_model")) + connector = RemoteEntailerConnector(config) prediction = asyncio.run( connector.predict( "The first contact is a romance novel set in the middle ages.", diff --git a/wafl/extractors/__init__.py b/wafl/extractors/__init__.py deleted file mode 100644 index ea96f559..00000000 --- a/wafl/extractors/__init__.py +++ /dev/null @@ -1 +0,0 @@ -print diff --git a/wafl/extractors/utils.py b/wafl/extractors/utils.py deleted file mode 100644 index 4401c22f..00000000 --- a/wafl/extractors/utils.py +++ /dev/null @@ -1,23 +0,0 @@ -import re - - -def get_answer_from_text(text): - _claim_yn = "The claim makes sense:\n" - pos = text.find(_claim_yn) + len(_claim_yn) - return text[pos] - - -def get_text_up_to_question(text): - _claim_yn = "The claim makes sense:\n" - return text[: text.find(_claim_yn) + len(_claim_yn)] - - -def get_function_description(text): - if "<" not in text: - return "" - - return re.sub(r".*<(.*)>$", r"\1", text, re.MULTILINE).strip() - - -def get_code(text): - return re.sub(r"(.*)<.*>$", r"\1", text, re.MULTILINE).strip() diff --git a/wafl/variables.py b/wafl/variables.py index 59f464f9..b2e183e7 100644 --- a/wafl/variables.py +++ b/wafl/variables.py @@ -1,9 +1,9 @@ def get_variables(): return { - "version": "0.1.2", + "version": "0.1.3", } def is_supported(wafl_llm_version): - supported_versions = ["0.1.0"] + supported_versions = ["0.1.1"] return wafl_llm_version in supported_versions