MuntasirHossain commited on
Commit
6c13065
·
verified ·
1 Parent(s): ed27ed0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -137,12 +137,21 @@ def demo():
137
  vector_db = gr.State()
138
  qa_chain = gr.State()
139
 
140
- gr.HTML("<center><h1>RAG PDF chatbot</h1><center>")
 
 
 
 
 
 
 
 
 
141
  gr.Markdown("""<b>Query your PDF documents!</b> This AI agent is designed to perform retrieval augmented generation (RAG) on PDF documents. The app is hosted on Hugging Face Hub for the sole purpose of demonstration. <b>Please do not upload confidential documents.</b>""")
142
 
143
  with gr.Row():
144
- # Left Column (thin)
145
- with gr.Column(scale=1):
146
  gr.Markdown("<b>Step 1 - Upload PDF documents and Initialize RAG pipeline</b>")
147
  document = gr.Files(height=140, file_count="multiple", file_types=[".pdf"], interactive=True, label="Upload PDF documents")
148
  db_btn = gr.Button("Create vector DB")
@@ -159,6 +168,8 @@ def demo():
159
  qachain_btn = gr.Button("Initialize QA Chatbot")
160
  llm_progress = gr.Textbox(value="Not initialized", show_label=False)
161
 
 
 
162
  # Right Column (wide)
163
  with gr.Column(scale=8):
164
  gr.Markdown("<b>Step 2 - Chat with your Document</b>")
@@ -196,5 +207,6 @@ def demo():
196
 
197
 
198
 
 
199
  if __name__ == "__main__":
200
  demo()
 
137
  vector_db = gr.State()
138
  qa_chain = gr.State()
139
 
140
+ gr.HTML("""
141
+ <style>
142
+ .gr-block.gr-box:nth-child(1) {
143
+ max-width: 180px;
144
+ flex: 0 0 180px !important;
145
+ }
146
+ </style>
147
+ <center><h1>RAG PDF chatbot</h1></center>
148
+ """)
149
+
150
  gr.Markdown("""<b>Query your PDF documents!</b> This AI agent is designed to perform retrieval augmented generation (RAG) on PDF documents. The app is hosted on Hugging Face Hub for the sole purpose of demonstration. <b>Please do not upload confidential documents.</b>""")
151
 
152
  with gr.Row():
153
+ # Left Column (force narrow with CSS)
154
+ with gr.Column(scale=1) as left_col:
155
  gr.Markdown("<b>Step 1 - Upload PDF documents and Initialize RAG pipeline</b>")
156
  document = gr.Files(height=140, file_count="multiple", file_types=[".pdf"], interactive=True, label="Upload PDF documents")
157
  db_btn = gr.Button("Create vector DB")
 
168
  qachain_btn = gr.Button("Initialize QA Chatbot")
169
  llm_progress = gr.Textbox(value="Not initialized", show_label=False)
170
 
171
+ left_col.style(container=True)
172
+
173
  # Right Column (wide)
174
  with gr.Column(scale=8):
175
  gr.Markdown("<b>Step 2 - Chat with your Document</b>")
 
207
 
208
 
209
 
210
+
211
  if __name__ == "__main__":
212
  demo()