SMU Library Chatbot
Browse files- .env.example +1 -1
- README.md +2 -2
- app.py +4 -2
.env.example
CHANGED
@@ -86,7 +86,7 @@ CHUNCK_SIZE=1024
|
|
86 |
CHUNK_OVERLAP=64
|
87 |
SOURCE_PATH="data/pdfs/smu_lib_html/"
|
88 |
|
89 |
-
# Index for SMU
|
90 |
FAISS_INDEX_PATH="data/smu_lib_index/"
|
91 |
|
92 |
# telegram bot
|
|
|
86 |
CHUNK_OVERLAP=64
|
87 |
SOURCE_PATH="data/pdfs/smu_lib_html/"
|
88 |
|
89 |
+
# Index for SMU Library Chatbot PDF files - chunk_size=1024 chunk_overlap=512
|
90 |
FAISS_INDEX_PATH="data/smu_lib_index/"
|
91 |
|
92 |
# telegram bot
|
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title: Chat with SMU
|
3 |
emoji: 👀
|
4 |
colorFrom: indigo
|
5 |
colorTo: blue
|
@@ -87,7 +87,7 @@ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-
|
|
87 |
|
88 |
## Talk to Your Own PDF Files
|
89 |
|
90 |
-
- The sample PDF books & documents are downloaded from the internet (for SMU
|
91 |
|
92 |
- You can also put your own PDF files into any folder specified in `SOURCE_PDFS_PATH` and run the command below to generate embeddings which will be stored in folder `FAISS_INDEX_PATH` or `CHROMADB_INDEX_PATH`. If both `*_INDEX_PATH` env vars are set, `FAISS_INDEX_PATH` takes precedence. Make sure the folder specified by `*_INDEX_PATH` doesn't exist; other wise the command will simply try to load index from the folder and do a simple similarity search, as a way to verify if embeddings are generated and stored properly. Please note the HuggingFace Embedding model specified by `HF_EMBEDDINGS_MODEL_NAME` will be used to generate the embeddings.
|
93 |
|
|
|
1 |
---
|
2 |
+
title: Chat with SMU Library Chatbot
|
3 |
emoji: 👀
|
4 |
colorFrom: indigo
|
5 |
colorTo: blue
|
|
|
87 |
|
88 |
## Talk to Your Own PDF Files
|
89 |
|
90 |
+
- The sample PDF books & documents are downloaded from the internet (for SMU Library Chatbot) and [PCI DSS official website](https://www.pcisecuritystandards.org/document_library/?category=pcidss) and the corresponding embeddings are stored in folders `data/ai_books` and `data/pci_dss_v4` respectively, which allows you to run locally without any additional effort.
|
91 |
|
92 |
- You can also put your own PDF files into any folder specified in `SOURCE_PDFS_PATH` and run the command below to generate embeddings which will be stored in folder `FAISS_INDEX_PATH` or `CHROMADB_INDEX_PATH`. If both `*_INDEX_PATH` env vars are set, `FAISS_INDEX_PATH` takes precedence. Make sure the folder specified by `*_INDEX_PATH` doesn't exist; other wise the command will simply try to load index from the folder and do a simple similarity search, as a way to verify if embeddings are generated and stored properly. Please note the HuggingFace Embedding model specified by `HF_EMBEDDINGS_MODEL_NAME` will be used to generate the embeddings.
|
93 |
|
app.py
CHANGED
@@ -44,7 +44,7 @@ if chat_with_llama_2:
|
|
44 |
qa_chain = ChatChain(llm_loader)
|
45 |
name = "Llama-2"
|
46 |
else:
|
47 |
-
name = "SMU
|
48 |
|
49 |
title = f"""<h1 align="left" style="min-width:200px; margin-top:0;"> Chat with {name} </h1>"""
|
50 |
|
@@ -216,5 +216,7 @@ with gr.Blocks(css=customCSS) as demo:
|
|
216 |
api_name="reset",
|
217 |
)
|
218 |
|
219 |
-
demo.title =
|
|
|
|
|
220 |
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(share=share_gradio_app)
|
|
|
44 |
qa_chain = ChatChain(llm_loader)
|
45 |
name = "Llama-2"
|
46 |
else:
|
47 |
+
name = "SMU Library Chatbot"
|
48 |
|
49 |
title = f"""<h1 align="left" style="min-width:200px; margin-top:0;"> Chat with {name} </h1>"""
|
50 |
|
|
|
216 |
api_name="reset",
|
217 |
)
|
218 |
|
219 |
+
demo.title = (
|
220 |
+
"Chat with SMU Library Chatbot" if chat_with_llama_2 else "Chat with Llama-2"
|
221 |
+
)
|
222 |
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(share=share_gradio_app)
|