Update app.py
Browse files
app.py
CHANGED
@@ -135,8 +135,8 @@ def upload_file(file_obj):
|
|
135 |
def demo():
|
136 |
# with gr.Blocks(theme=gr.themes.Default(primary_hue="sky")) as demo:
|
137 |
with gr.Blocks(theme=gr.themes.Default(primary_hue="red", secondary_hue="pink", neutral_hue = "sky")) as demo:
|
138 |
-
vector_db = gr.State(
|
139 |
-
qa_chain = gr.State(
|
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. \
|
142 |
<b>Please do not upload confidential documents.</b>
|
@@ -209,8 +209,8 @@ def demo():
|
|
209 |
inputs=None, \
|
210 |
outputs=[chatbot, doc_source1, source1_page, doc_source2, source2_page, doc_source3, source3_page], \
|
211 |
queue=False)
|
212 |
-
|
213 |
-
demo.launch(debug=True)
|
214 |
|
215 |
|
216 |
if __name__ == "__main__":
|
|
|
135 |
def demo():
|
136 |
# with gr.Blocks(theme=gr.themes.Default(primary_hue="sky")) as demo:
|
137 |
with gr.Blocks(theme=gr.themes.Default(primary_hue="red", secondary_hue="pink", neutral_hue = "sky")) as demo:
|
138 |
+
vector_db = gr.State()
|
139 |
+
qa_chain = gr.State()
|
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. \
|
142 |
<b>Please do not upload confidential documents.</b>
|
|
|
209 |
inputs=None, \
|
210 |
outputs=[chatbot, doc_source1, source1_page, doc_source2, source2_page, doc_source3, source3_page], \
|
211 |
queue=False)
|
212 |
+
demo.queue().launch(debug=True)
|
213 |
+
# demo.launch(debug=True)
|
214 |
|
215 |
|
216 |
if __name__ == "__main__":
|