Rename postfix to suffix to match upstream
This commit is contained in:
parent
0e9f227afd
commit
1895c11033
3 changed files with 5 additions and 4 deletions
|
@ -63,6 +63,7 @@ params = GptParams(
|
||||||
interactive=True,
|
interactive=True,
|
||||||
antiprompt=[f"{USER_NAME}:"],
|
antiprompt=[f"{USER_NAME}:"],
|
||||||
input_prefix=" ",
|
input_prefix=" ",
|
||||||
|
input_suffix=f"{AI_NAME}:",
|
||||||
prompt=prompt,
|
prompt=prompt,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ class GptParams:
|
||||||
prompt: str = ""
|
prompt: str = ""
|
||||||
path_session: str = ""
|
path_session: str = ""
|
||||||
input_prefix: str = " "
|
input_prefix: str = " "
|
||||||
|
input_suffix: str = ""
|
||||||
antiprompt: List[str] = field(default_factory=list)
|
antiprompt: List[str] = field(default_factory=list)
|
||||||
|
|
||||||
lora_adapter: str = ""
|
lora_adapter: str = ""
|
||||||
|
@ -64,7 +65,6 @@ class GptParams:
|
||||||
# Set to "\nUser:" etc.
|
# Set to "\nUser:" etc.
|
||||||
# This is an alternative to input_prefix which always adds it, so it potentially duplicates "User:""
|
# This is an alternative to input_prefix which always adds it, so it potentially duplicates "User:""
|
||||||
fix_prefix: str = ""
|
fix_prefix: str = ""
|
||||||
output_postfix: str = ""
|
|
||||||
input_echo: bool = True,
|
input_echo: bool = True,
|
||||||
|
|
||||||
# Default instructions for Alpaca
|
# Default instructions for Alpaca
|
||||||
|
@ -110,6 +110,7 @@ def gpt_params_parse(argv = None):
|
||||||
parser.add_argument("-f", "--file", type=str, default=None, help="file containing initial prompt to load",dest="file")
|
parser.add_argument("-f", "--file", type=str, default=None, help="file containing initial prompt to load",dest="file")
|
||||||
parser.add_argument("--session", type=str, default=None, help="file to cache model state in (may be large!)",dest="path_session")
|
parser.add_argument("--session", type=str, default=None, help="file to cache model state in (may be large!)",dest="path_session")
|
||||||
parser.add_argument("--in-prefix", type=str, default="", help="string to prefix user inputs with", dest="input_prefix")
|
parser.add_argument("--in-prefix", type=str, default="", help="string to prefix user inputs with", dest="input_prefix")
|
||||||
|
parser.add_argument("--in-suffix", type=str, default="", help="append to input", dest="input_suffix")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-r",
|
"-r",
|
||||||
"--reverse-prompt",
|
"--reverse-prompt",
|
||||||
|
@ -158,7 +159,6 @@ def gpt_params_parse(argv = None):
|
||||||
|
|
||||||
#Custom args
|
#Custom args
|
||||||
parser.add_argument("--fix-prefix", type=str, default="", help="append to input when generated n_predict tokens", dest="fix_prefix")
|
parser.add_argument("--fix-prefix", type=str, default="", help="append to input when generated n_predict tokens", dest="fix_prefix")
|
||||||
parser.add_argument("--out-postfix", type=str, default="", help="append to input", dest="output_postfix")
|
|
||||||
parser.add_argument("--input-noecho", action="store_false", help="dont output the input", dest="input_echo")
|
parser.add_argument("--input-noecho", action="store_false", help="dont output the input", dest="input_echo")
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
|
|
@ -527,8 +527,8 @@ n_keep = {self.params.n_keep}
|
||||||
self.input(self.read_input())
|
self.input(self.read_input())
|
||||||
else:
|
else:
|
||||||
print(self.params.input_prefix, end="")
|
print(self.params.input_prefix, end="")
|
||||||
self.input(f"{self.params.input_prefix}{self.read_input()}{self.params.output_postfix}")
|
self.input(f"{self.params.input_prefix}{self.read_input()}{self.params.input_suffix}")
|
||||||
print(self.params.output_postfix,end="")
|
print(self.params.input_suffix,end="")
|
||||||
self.set_color(CONSOLE_COLOR_DEFAULT)
|
self.set_color(CONSOLE_COLOR_DEFAULT)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue