Fixed issue with token replacements

This commit is contained in:
Jaret Burkett
2023-09-07 13:42:39 -06:00
parent 3feb663a51
commit 92a086d5a5
3 changed files with 7 additions and 6 deletions

View File

@@ -159,7 +159,7 @@ class Embedding:
output_prompt = output_prompt.replace(to_replace, replace_with)
# see how many times replace_with is in the prompt
num_instances = prompt.count(replace_with)
num_instances = output_prompt.count(replace_with)
if num_instances == 0 and add_if_not_present:
# add it to the beginning of the prompt