Spaces:
Sleeping
Sleeping
Merge branch 'GH-main' into HF-main
Browse files
app.py
CHANGED
|
@@ -44,8 +44,16 @@ def get_rag_response(message, history, rag):
|
|
| 44 |
return response_str
|
| 45 |
|
| 46 |
with gr.Blocks() as demo:
|
| 47 |
-
gr.Markdown("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
# PDFs
|
|
|
|
| 49 |
pdfpaths = gr.State([])
|
| 50 |
file_output = gr.File()
|
| 51 |
upload_button = gr.UploadButton("Upload PDF(s)", file_count="multiple")
|
|
@@ -63,7 +71,7 @@ with gr.Blocks() as demo:
|
|
| 63 |
inputs=[pdfpaths],
|
| 64 |
outputs=[init_status, rag_instance] # Output: status message and the RAG instance
|
| 65 |
)
|
| 66 |
-
gr.Markdown('## Chat with Rag-Chatbot')
|
| 67 |
# Chat Interface for RAG-Chatbot
|
| 68 |
gr.ChatInterface(
|
| 69 |
fn=get_rag_response,
|
|
|
|
| 44 |
return response_str
|
| 45 |
|
| 46 |
with gr.Blocks() as demo:
|
| 47 |
+
gr.Markdown("# RAG-Chatbot")
|
| 48 |
+
gr.Markdown("## Instructions")
|
| 49 |
+
gr.Markdown("""
|
| 50 |
+
Upload PDF's that will form the basis of the database of our RAG-Chatbot.
|
| 51 |
+
Once done adding documents (multiple uploads allowed), initialize the Rag-Chatbot.
|
| 52 |
+
Building time depends on the number and length of uploaded documents.
|
| 53 |
+
When the building is done, you can start chatting!
|
| 54 |
+
""")
|
| 55 |
# PDFs
|
| 56 |
+
gr.Markdown("## 1. Build a RAG-Chatbot")
|
| 57 |
pdfpaths = gr.State([])
|
| 58 |
file_output = gr.File()
|
| 59 |
upload_button = gr.UploadButton("Upload PDF(s)", file_count="multiple")
|
|
|
|
| 71 |
inputs=[pdfpaths],
|
| 72 |
outputs=[init_status, rag_instance] # Output: status message and the RAG instance
|
| 73 |
)
|
| 74 |
+
gr.Markdown('## 2. Chat with Rag-Chatbot')
|
| 75 |
# Chat Interface for RAG-Chatbot
|
| 76 |
gr.ChatInterface(
|
| 77 |
fn=get_rag_response,
|