Spaces:
Runtime error
Runtime error
Update run.py
Browse files
run.py
CHANGED
|
@@ -127,9 +127,6 @@ else:
|
|
| 127 |
#params=llama_cpp.llama_context_default_params()
|
| 128 |
#params.n_ctx
|
| 129 |
|
| 130 |
-
# Gradio-GUI
|
| 131 |
-
#------------
|
| 132 |
-
|
| 133 |
# Gradio-GUI
|
| 134 |
#------------
|
| 135 |
import re
|
|
@@ -192,7 +189,7 @@ def extend_prompt(message="", history=None, system=None, RAGAddon=None, system2=
|
|
| 192 |
for user_message, bot_response in history[-historylimit:]:
|
| 193 |
if user_message is None: user_message = ""
|
| 194 |
if bot_response is None: bot_response = ""
|
| 195 |
-
bot_response = re.sub("\n\n<details>.*?</details>","", bot_response, flags=re.DOTALL) # remove RAG-compontents
|
| 196 |
if removeHTML==True: bot_response = re.sub("<(.*?)>","\n", bot_response) # remove HTML-components in general (may cause bugs with markdown-rendering)
|
| 197 |
if user_message is not None: prompt += template1.format(message=user_message[:zeichenlimit])
|
| 198 |
if bot_response is not None: prompt += template2.format(response=bot_response[:zeichenlimit])
|
|
@@ -201,7 +198,6 @@ def extend_prompt(message="", history=None, system=None, RAGAddon=None, system2=
|
|
| 201 |
prompt += system2
|
| 202 |
return startOfString+prompt
|
| 203 |
|
| 204 |
-
|
| 205 |
import gradio as gr
|
| 206 |
import requests
|
| 207 |
import json
|
|
|
|
| 127 |
#params=llama_cpp.llama_context_default_params()
|
| 128 |
#params.n_ctx
|
| 129 |
|
|
|
|
|
|
|
|
|
|
| 130 |
# Gradio-GUI
|
| 131 |
#------------
|
| 132 |
import re
|
|
|
|
| 189 |
for user_message, bot_response in history[-historylimit:]:
|
| 190 |
if user_message is None: user_message = ""
|
| 191 |
if bot_response is None: bot_response = ""
|
| 192 |
+
bot_response = re.sub("\n\n<details(| open)>.*?</details>","", bot_response, flags=re.DOTALL) # remove RAG-compontents
|
| 193 |
if removeHTML==True: bot_response = re.sub("<(.*?)>","\n", bot_response) # remove HTML-components in general (may cause bugs with markdown-rendering)
|
| 194 |
if user_message is not None: prompt += template1.format(message=user_message[:zeichenlimit])
|
| 195 |
if bot_response is not None: prompt += template2.format(response=bot_response[:zeichenlimit])
|
|
|
|
| 198 |
prompt += system2
|
| 199 |
return startOfString+prompt
|
| 200 |
|
|
|
|
| 201 |
import gradio as gr
|
| 202 |
import requests
|
| 203 |
import json
|