From 73cf54fcbfe7182a83344301ce95e778565f605b Mon Sep 17 00:00:00 2001 From: Dev Aggarwal Date: Thu, 12 Oct 2023 17:05:37 +0530 Subject: [PATCH] just going to remove html2text since its not being used only --- daras_ai/text_format.py | 5 +---- poetry.lock | 13 +------------ pyproject.toml | 1 - recipes/LetterWriter.py | 1 - 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/daras_ai/text_format.py b/daras_ai/text_format.py index 562533722..f68ca85b8 100644 --- a/daras_ai/text_format.py +++ b/daras_ai/text_format.py @@ -2,12 +2,11 @@ import parse from glom import glom -from html2text import html2text input_spec_parse_pattern = "{" * 5 + "}" * 5 -def daras_ai_format_str(format_str, variables, do_html2text=False): +def daras_ai_format_str(format_str, variables): input_spec_results: list[parse.Result] = list( parse.findall(input_spec_parse_pattern, format_str) ) @@ -18,8 +17,6 @@ def daras_ai_format_str(format_str, variables, do_html2text=False): variable_value = "" else: variable_value = str(variable_value) - if do_html2text: - variable_value = html2text(variable_value) if isinstance(variable_value, str): variable_value = variable_value.strip() format_str = format_str.replace("{{" + spec + "}}", str(variable_value)) diff --git a/poetry.lock b/poetry.lock index de91446e3..92fa23816 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2050,17 +2050,6 @@ files = [ beautifulsoup4 = "*" lxml = ">=4.6.5" -[[package]] -name = "html2text" -version = "2020.1.16" -description = "Turn HTML into equivalent Markdown-structured text." -optional = false -python-versions = ">=3.5" -files = [ - {file = "html2text-2020.1.16-py3-none-any.whl", hash = "sha256:c7c629882da0cf377d66f073329ccf34a12ed2adf0169b9285ae4e63ef54c82b"}, - {file = "html2text-2020.1.16.tar.gz", hash = "sha256:e296318e16b059ddb97f7a8a1d6a5c1d7af4544049a01e261731d2d5cc277bbb"}, -] - [[package]] name = "httpcore" version = "0.16.3" @@ -6138,4 +6127,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.13" -content-hash = "8cb6f5a826bc1bbd06c65a871e027cf967178cd2e8e6c33c262b80a43a772cfe" +content-hash = "33202ba8475c3bf85ebde0d165d29d480815bfb4432bed72efd8c48a75b1bef7" diff --git a/pyproject.toml b/pyproject.toml index 6c697412c..f1dfbeddc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ python-decouple = "^3.6" requests = "^2.28.1" glom = "^22.1.0" parse = "^1.19.0" -html2text = "^2020.1.16" pandas = "^2.0.1" google-cloud-firestore = "^2.7.0" replicate = "^0.4.0" diff --git a/recipes/LetterWriter.py b/recipes/LetterWriter.py index 1867edfdd..23265c4c2 100644 --- a/recipes/LetterWriter.py +++ b/recipes/LetterWriter.py @@ -256,7 +256,6 @@ def run(self, state: dict) -> typing.Iterator[str | None]: input_prompt = daras_ai_format_str( format_str=request.input_prompt, variables=response_json, - do_html2text=request.strip_html_2_text, ) state["generated_input_prompt"] = input_prompt