Spaces:
Sleeping
Sleeping
Tafazzul-Nadeeem commited on
Commit ·
55c357e
1
Parent(s): 8329220
Bot initial message
Browse files- app.py +10 -11
- faiss_index_store/index.faiss +0 -0
- faiss_index_store/index.pkl +0 -0
- ratelist_offers.docx +0 -0
- ratelist_offers.pdf +0 -0
app.py
CHANGED
|
@@ -22,18 +22,13 @@ You can ask questions or share part of your prescription (without names or any p
|
|
| 22 |
Disclaimer: I am not a medical professional, and my responses are based on the information available to me.
|
| 23 |
Always consult a qualified healthcare provider for medical advice or concerns.
|
| 24 |
Also, the final service rates and offers will be available at the time of booking, and may vary from the information provided here.
|
| 25 |
-
|
| 26 |
"""
|
| 27 |
openai_opening_message = """"You are a helpful assistant of a diagnostic services business.
|
| 28 |
The system uses RAG to retrieve relevant information from a knowledge base.
|
| 29 |
You can also answer questions based on the information provided by the user."""
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
# )
|
| 33 |
-
chatbot = gr.Chatbot(type="messages", value=[
|
| 34 |
-
{"role": "assistant", "content": "Hi there! How can I assist you?"}])
|
| 35 |
-
# print(chatbot)
|
| 36 |
-
# msg = gr.Textbox()
|
| 37 |
chat_input = gr.MultimodalTextbox(
|
| 38 |
interactive=True,
|
| 39 |
file_count="multiple",
|
|
@@ -75,7 +70,7 @@ You can also answer questions based on the information provided by the user."""
|
|
| 75 |
|
| 76 |
def respond(history):
|
| 77 |
# print("history", history)
|
| 78 |
-
if len(history) ==
|
| 79 |
# print("Inside")
|
| 80 |
history.insert(0,{"role": "system", "content": openai_opening_message})
|
| 81 |
# print("history after insert", history)
|
|
@@ -135,7 +130,11 @@ You can also answer questions based on the information provided by the user."""
|
|
| 135 |
history[-1]['content'] += character
|
| 136 |
time.sleep(0.005)
|
| 137 |
yield history
|
| 138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
chat_msg = chat_input.submit(
|
| 140 |
add_message, [chatbot, chat_input], [chatbot, chat_input]
|
| 141 |
)
|
|
@@ -144,4 +143,4 @@ You can also answer questions based on the information provided by the user."""
|
|
| 144 |
|
| 145 |
|
| 146 |
if __name__ == "__main__":
|
| 147 |
-
demo.launch()
|
|
|
|
| 22 |
Disclaimer: I am not a medical professional, and my responses are based on the information available to me.
|
| 23 |
Always consult a qualified healthcare provider for medical advice or concerns.
|
| 24 |
Also, the final service rates and offers will be available at the time of booking, and may vary from the information provided here.
|
| 25 |
+
**Can I help you with anything?**
|
| 26 |
"""
|
| 27 |
openai_opening_message = """"You are a helpful assistant of a diagnostic services business.
|
| 28 |
The system uses RAG to retrieve relevant information from a knowledge base.
|
| 29 |
You can also answer questions based on the information provided by the user."""
|
| 30 |
+
|
| 31 |
+
chatbot = gr.Chatbot(type="messages")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
chat_input = gr.MultimodalTextbox(
|
| 33 |
interactive=True,
|
| 34 |
file_count="multiple",
|
|
|
|
| 70 |
|
| 71 |
def respond(history):
|
| 72 |
# print("history", history)
|
| 73 |
+
if len(history) == 2:
|
| 74 |
# print("Inside")
|
| 75 |
history.insert(0,{"role": "system", "content": openai_opening_message})
|
| 76 |
# print("history after insert", history)
|
|
|
|
| 130 |
history[-1]['content'] += character
|
| 131 |
time.sleep(0.005)
|
| 132 |
yield history
|
| 133 |
+
def load_welcome():
|
| 134 |
+
return [
|
| 135 |
+
{"role": "assistant", "content": bot_welcome_message}
|
| 136 |
+
]
|
| 137 |
+
demo.load(load_welcome, None, chatbot, api_name="load_welcome")
|
| 138 |
chat_msg = chat_input.submit(
|
| 139 |
add_message, [chatbot, chat_input], [chatbot, chat_input]
|
| 140 |
)
|
|
|
|
| 143 |
|
| 144 |
|
| 145 |
if __name__ == "__main__":
|
| 146 |
+
demo.launch()
|
faiss_index_store/index.faiss
CHANGED
|
Binary files a/faiss_index_store/index.faiss and b/faiss_index_store/index.faiss differ
|
|
|
faiss_index_store/index.pkl
CHANGED
|
Binary files a/faiss_index_store/index.pkl and b/faiss_index_store/index.pkl differ
|
|
|
ratelist_offers.docx
CHANGED
|
Binary files a/ratelist_offers.docx and b/ratelist_offers.docx differ
|
|
|
ratelist_offers.pdf
CHANGED
|
Binary files a/ratelist_offers.pdf and b/ratelist_offers.pdf differ
|
|
|