Update app.py
Browse files
app.py
CHANGED
|
@@ -137,24 +137,12 @@ def demo():
|
|
| 137 |
vector_db = gr.State()
|
| 138 |
qa_chain = gr.State()
|
| 139 |
|
| 140 |
-
|
| 141 |
-
gr.HTML("""
|
| 142 |
-
<style>
|
| 143 |
-
.gr-block.gr-box { display: flex; }
|
| 144 |
-
.gr-block.gr-box > div:first-child {
|
| 145 |
-
max-width: 180px !important;
|
| 146 |
-
flex: 0 0 180px !important;
|
| 147 |
-
}
|
| 148 |
-
</style>
|
| 149 |
-
<center><h1>RAG PDF chatbot</h1></center>
|
| 150 |
-
""")
|
| 151 |
-
|
| 152 |
-
|
| 153 |
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>""")
|
| 154 |
|
| 155 |
with gr.Row():
|
| 156 |
-
# Left Column (
|
| 157 |
-
with gr.Column(scale=1)
|
| 158 |
gr.Markdown("<b>Step 1 - Upload PDF documents and Initialize RAG pipeline</b>")
|
| 159 |
document = gr.Files(height=140, file_count="multiple", file_types=[".pdf"], interactive=True, label="Upload PDF documents")
|
| 160 |
db_btn = gr.Button("Create vector DB")
|
|
@@ -171,8 +159,6 @@ def demo():
|
|
| 171 |
qachain_btn = gr.Button("Initialize QA Chatbot")
|
| 172 |
llm_progress = gr.Textbox(value="Not initialized", show_label=False)
|
| 173 |
|
| 174 |
-
|
| 175 |
-
|
| 176 |
# Right Column (wide)
|
| 177 |
with gr.Column(scale=8):
|
| 178 |
gr.Markdown("<b>Step 2 - Chat with your Document</b>")
|
|
@@ -209,7 +195,5 @@ def demo():
|
|
| 209 |
demo.queue().launch(debug=True)
|
| 210 |
|
| 211 |
|
| 212 |
-
|
| 213 |
-
|
| 214 |
if __name__ == "__main__":
|
| 215 |
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 |
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>")
|
|
|
|
| 195 |
demo.queue().launch(debug=True)
|
| 196 |
|
| 197 |
|
|
|
|
|
|
|
| 198 |
if __name__ == "__main__":
|
| 199 |
demo()
|