Skip to content

Commit 7479d6b

Browse files
committed
cleanup stale code
1 parent d2e411c commit 7479d6b

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

prompt_poet/prompt.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
import inspect
55
import logging
66
import math
7+
import re
78
from dataclasses import dataclass
89
from functools import reduce
10+
from typing import Callable
911

1012
import yaml
1113
from examples import cai_helpers
1214
from pp_exceptions import TruncationError
13-
from template_loaders import TemplateLoader
1415
from template import Template
16+
from template_loaders import TemplateLoader
1517
from tokenizer import get_encode_func
16-
from typing import Callable
1718

1819
SPACE_MARKER = "<|space|>"
1920

@@ -97,12 +98,6 @@ def __init__(
9798
from_cache: bool = False,
9899
from_examples: bool = False,
99100
space_marker: str = SPACE_MARKER,
100-
newline: str = "\n",
101-
escaped_newline: str = "\\n",
102-
carriage_return: str = "\r",
103-
escaped_carriage_return: str = "\\r",
104-
single_quote: str = "'",
105-
escaped_single_quote: str = "'",
106101
allow_token_overrides: bool = False,
107102
):
108103
"""Initialize the prompt object."""
@@ -502,7 +497,6 @@ def _escape_special_characters(self, string: str) -> str:
502497

503498
def _unescape_special_characters(self, string: str) -> str:
504499
"""Unescape special characters."""
505-
import re
506500
string = re.sub(r'\\u([0-9a-fA-F]{4})', lambda m: chr(int(m.group(1), 16)), string)
507501

508502
return (

0 commit comments

Comments
 (0)