Skip to content

Commit

Permalink
just going to remove html2text since its not being used only
Browse files Browse the repository at this point in the history
  • Loading branch information
devxpy committed Oct 12, 2023
1 parent 0364246 commit 73cf54f
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
5 changes: 1 addition & 4 deletions daras_ai/text_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand All @@ -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))
Expand Down
13 changes: 1 addition & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion recipes/LetterWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 73cf54f

Please sign in to comment.