fruitpicker01 commited on
Commit
48aa500
·
verified ·
1 Parent(s): b75b7a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -296,6 +296,7 @@ def generate_final_prompt_from_display(prompt_text, single_approach, is_prompt_1
296
  prompt_text = prompt_text.replace(other_prefix, "")
297
  prompt_text = prompt_text.replace(other_suffix, "")
298
  prompt_text = prompt_text.replace(" / ", " ")
 
299
  if chosen_prefix not in prompt_text:
300
  prompt_text = re.sub(r"с учетом пробелов\. [^.\n]*\.", f"с учетом пробелов. {chosen_prefix}.", prompt_text)
301
  if chosen_suffix not in prompt_text:
 
296
  prompt_text = prompt_text.replace(other_prefix, "")
297
  prompt_text = prompt_text.replace(other_suffix, "")
298
  prompt_text = prompt_text.replace(" / ", " ")
299
+ prompt_text = re.sub(r"\s{2,}", " ", prompt_text).strip()
300
  if chosen_prefix not in prompt_text:
301
  prompt_text = re.sub(r"с учетом пробелов\. [^.\n]*\.", f"с учетом пробелов. {chosen_prefix}.", prompt_text)
302
  if chosen_suffix not in prompt_text: