Update app.py
Browse files
app.py
CHANGED
|
@@ -14,9 +14,14 @@ import os
|
|
| 14 |
import sys
|
| 15 |
import pandas as pd
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
def conversational_chat(query):
|
| 18 |
output = llm_chain.predict(human_input=query)
|
| 19 |
-
return output
|
| 20 |
|
| 21 |
|
| 22 |
user_api_key = st.sidebar.text_input(
|
|
|
|
| 14 |
import sys
|
| 15 |
import pandas as pd
|
| 16 |
|
| 17 |
+
def extract_text_from_html(html):
|
| 18 |
+
cleanr = re.compile('<.*?>')
|
| 19 |
+
cleantext = re.sub(cleanr, '', html)
|
| 20 |
+
return cleantext.strip()
|
| 21 |
+
|
| 22 |
def conversational_chat(query):
|
| 23 |
output = llm_chain.predict(human_input=query)
|
| 24 |
+
return extract_text_from_html(output)
|
| 25 |
|
| 26 |
|
| 27 |
user_api_key = st.sidebar.text_input(
|