Commit
·
6abee2b
1
Parent(s):
4659cc6
text box
Browse files
app.py
CHANGED
@@ -68,16 +68,13 @@ def pdf_changes(pdf_doc):
|
|
68 |
documents = load_documents(pdf_doc)
|
69 |
global full_summary
|
70 |
full_summary = generate_summary(documents)
|
71 |
-
summary_state.value = full_summary
|
72 |
-
|
73 |
-
db, qa = setup_retrieval(documents)
|
74 |
-
summary_box.set_value(full_summary)
|
75 |
return f"Ready. Full Summary loaded."
|
76 |
except Exception as e:
|
77 |
return f"Error processing PDF: {str(e)}"
|
78 |
|
79 |
|
80 |
-
|
81 |
def clear_data():
|
82 |
global qa, db
|
83 |
qa = None
|
@@ -169,7 +166,8 @@ with gr.Blocks(css=css) as demo:
|
|
169 |
placeholder="Summary will appear here.",
|
170 |
interactive=False,
|
171 |
rows=5,
|
172 |
-
elem_id="summary_box"
|
|
|
173 |
)
|
174 |
|
175 |
|
@@ -192,4 +190,4 @@ with gr.Blocks(css=css) as demo:
|
|
192 |
bot, chatbot, chatbot
|
193 |
)
|
194 |
|
195 |
-
demo.launch()
|
|
|
68 |
documents = load_documents(pdf_doc)
|
69 |
global full_summary
|
70 |
full_summary = generate_summary(documents)
|
71 |
+
summary_state.value = full_summary # Update the state variable
|
72 |
+
# ... (rest of your code)
|
|
|
|
|
73 |
return f"Ready. Full Summary loaded."
|
74 |
except Exception as e:
|
75 |
return f"Error processing PDF: {str(e)}"
|
76 |
|
77 |
|
|
|
78 |
def clear_data():
|
79 |
global qa, db
|
80 |
qa = None
|
|
|
166 |
placeholder="Summary will appear here.",
|
167 |
interactive=False,
|
168 |
rows=5,
|
169 |
+
elem_id="summary_box",
|
170 |
+
state=summary_state # Bind the state here
|
171 |
)
|
172 |
|
173 |
|
|
|
190 |
bot, chatbot, chatbot
|
191 |
)
|
192 |
|
193 |
+
demo.launch()
|