AFischer1985 commited on
Commit
8c750de
1 Parent(s): 0706958

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +1 -1
run.py CHANGED
@@ -172,7 +172,7 @@ def extend_prompt(message="", history=None, system=None, RAGAddon=None, system2=
172
  for user_message, bot_response in history[-historylimit:]:
173
  if user_message is None: user_message = ""
174
  if bot_response is None: bot_response = ""
175
- bot_response = re.sub("\n\n<details>((.|\n)*?)</details>","", bot_response) # remove RAG-compontents
176
  if removeHTML==True: bot_response = re.sub("<(.*?)>","\n", bot_response) # remove HTML-components in general (may cause bugs with markdown-rendering)
177
  if user_message is not None: prompt += template1.format(message=user_message[:zeichenlimit])
178
  if bot_response is not None: prompt += template2.format(response=bot_response[:zeichenlimit])
 
172
  for user_message, bot_response in history[-historylimit:]:
173
  if user_message is None: user_message = ""
174
  if bot_response is None: bot_response = ""
175
+ bot_response = re.sub("\n\n<details>.*?</details>","", bot_response, flags=re.DOTALL) # remove RAG-compontents
176
  if removeHTML==True: bot_response = re.sub("<(.*?)>","\n", bot_response) # remove HTML-components in general (may cause bugs with markdown-rendering)
177
  if user_message is not None: prompt += template1.format(message=user_message[:zeichenlimit])
178
  if bot_response is not None: prompt += template2.format(response=bot_response[:zeichenlimit])