Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=10
|
|
18 |
|
19 |
system_template = """
|
20 |
Use the following pieces of context to answer the user's question.
|
21 |
-
Please respond as if you were
|
22 |
If you don't know the answer, just say that you don't know, don't try to make up an answer.
|
23 |
You can make inferences based on the context as long as it still faithfully represents the feedback.
|
24 |
|
@@ -41,7 +41,7 @@ chain_type_kwargs = {"prompt": prompt}
|
|
41 |
|
42 |
@cl.author_rename
|
43 |
def rename(orig_author: str):
|
44 |
-
rename_dict = {"RetrievalQA": "Consulting
|
45 |
return rename_dict.get(orig_author, orig_author)
|
46 |
|
47 |
@cl.on_chat_start
|
@@ -50,7 +50,7 @@ async def init():
|
|
50 |
await msg.send()
|
51 |
|
52 |
# build FAISS index from csv
|
53 |
-
loader = CSVLoader(file_path="./data/
|
54 |
data = loader.load()
|
55 |
documents = text_splitter.transform_documents(data)
|
56 |
store = LocalFileStore("./cache/")
|
@@ -99,7 +99,7 @@ async def main(message):
|
|
99 |
visited_sources.add(source)
|
100 |
# Create the text element referenced in the message
|
101 |
source_elements.append(
|
102 |
-
cl.Text(content="
|
103 |
)
|
104 |
|
105 |
if source_elements:
|
|
|
18 |
|
19 |
system_template = """
|
20 |
Use the following pieces of context to answer the user's question.
|
21 |
+
Please respond as if you were a a researcher on patient's experience.
|
22 |
If you don't know the answer, just say that you don't know, don't try to make up an answer.
|
23 |
You can make inferences based on the context as long as it still faithfully represents the feedback.
|
24 |
|
|
|
41 |
|
42 |
@cl.author_rename
|
43 |
def rename(orig_author: str):
|
44 |
+
rename_dict = {"RetrievalQA": "Consulting patient experience"}
|
45 |
return rename_dict.get(orig_author, orig_author)
|
46 |
|
47 |
@cl.on_chat_start
|
|
|
50 |
await msg.send()
|
51 |
|
52 |
# build FAISS index from csv
|
53 |
+
loader = CSVLoader(file_path="./data/adhd-twitter.csv", source_column="url")
|
54 |
data = loader.load()
|
55 |
documents = text_splitter.transform_documents(data)
|
56 |
store = LocalFileStore("./cache/")
|
|
|
99 |
visited_sources.add(source)
|
100 |
# Create the text element referenced in the message
|
101 |
source_elements.append(
|
102 |
+
cl.Text(content="twitter" + source, name="urL")
|
103 |
)
|
104 |
|
105 |
if source_elements:
|