AFischer1985 commited on
Commit
b62865b
1 Parent(s): 894a07b

Update run.py

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