Spaces:
Running
Running
sultan-hassan
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,6 @@ from langchain_chroma import Chroma
|
|
17 |
vectorstore = Chroma(
|
18 |
collection_name="medical_dataset_store",
|
19 |
embedding_function=embed_model,
|
20 |
-
persist_directory="./",
|
21 |
)
|
22 |
|
23 |
# add data to vector nstore
|
@@ -61,19 +60,28 @@ initial_history = [("", greetingsmessage)]
|
|
61 |
|
62 |
title = "MediGuide ChatBot"
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
outputs=gr.Chatbot(label="Chat History"),
|
72 |
-
allow_flagging="never",
|
73 |
-
fill_height=True,
|
74 |
-
theme="glass",
|
75 |
)
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
if __name__ == "__main__":
|
79 |
demo.launch()
|
|
|
17 |
vectorstore = Chroma(
|
18 |
collection_name="medical_dataset_store",
|
19 |
embedding_function=embed_model,
|
|
|
20 |
)
|
21 |
|
22 |
# add data to vector nstore
|
|
|
60 |
|
61 |
title = "MediGuide ChatBot"
|
62 |
|
63 |
+
demo = gr.ChatInterface(fn=rag_memory_stream,
|
64 |
+
type="messages",
|
65 |
+
title=title,
|
66 |
+
description=description,
|
67 |
+
fill_height=True,
|
68 |
+
examples=examples,
|
69 |
+
theme="glass",
|
|
|
|
|
|
|
|
|
70 |
)
|
71 |
|
72 |
+
# it should be gr.ChatInterface not gr.Interface, I made this pull request. You can continue work on the greetingmessage.
|
73 |
+
#demo = gr.Interface(
|
74 |
+
# title=title,
|
75 |
+
# fn=rag_memory_stream,
|
76 |
+
# inputs=[
|
77 |
+
# gr.Chatbot(value=initial_history, label="Chat History"),"text"
|
78 |
+
# ],
|
79 |
+
# outputs=gr.Chatbot(label="Chat History"),
|
80 |
+
# allow_flagging="never",
|
81 |
+
# fill_height=True,
|
82 |
+
# theme="glass",
|
83 |
+
#)
|
84 |
+
|
85 |
|
86 |
if __name__ == "__main__":
|
87 |
demo.launch()
|