OnurKerimoglu commited on
Commit
22ca913
·
1 Parent(s): d7dccbd

app: minor Interface updates

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -47,13 +47,15 @@ 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")
@@ -63,7 +65,7 @@ with gr.Blocks() as demo:
63
  outputs=[file_output, pdfpaths])
64
  # State to store the RAG instance
65
  rag_instance = gr.State(None) # Initially None
66
- init_button = gr.Button("Initialize RAG-Chatbot")
67
  init_status = gr.Textbox(label="Initialization Status", interactive=False)
68
  # Event handlers
69
  init_button.click(
@@ -71,7 +73,7 @@ with gr.Blocks() as demo:
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,
 
47
  gr.Markdown("# RAG-Chatbot")
48
  gr.Markdown("## Instructions")
49
  gr.Markdown("""
50
+ Upload PDF's that will form the basis of the database for our RAG-Chatbot.
51
+ Once done adding documents (multiple uploads allowed), click `Initialize` to start the building process.
52
+ Note that building time depends on the number and length of uploaded documents.
53
+ When the building is done,
54
+ as will be indicated by `RAG-Chatbot initialized successfully!` in the Initialization Status box,
55
+ you can start chatting!
56
  """)
57
  # PDFs
58
+ gr.Markdown("## 1. Build the bot")
59
  pdfpaths = gr.State([])
60
  file_output = gr.File()
61
  upload_button = gr.UploadButton("Upload PDF(s)", file_count="multiple")
 
65
  outputs=[file_output, pdfpaths])
66
  # State to store the RAG instance
67
  rag_instance = gr.State(None) # Initially None
68
+ init_button = gr.Button("Initialize")
69
  init_status = gr.Textbox(label="Initialization Status", interactive=False)
70
  # Event handlers
71
  init_button.click(
 
73
  inputs=[pdfpaths],
74
  outputs=[init_status, rag_instance] # Output: status message and the RAG instance
75
  )
76
+ gr.Markdown('## 2. Chat')
77
  # Chat Interface for RAG-Chatbot
78
  gr.ChatInterface(
79
  fn=get_rag_response,