Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -84,15 +84,18 @@ def export_conversation_to_pdf(conversation_history):
|
|
| 84 |
return pdf_path
|
| 85 |
|
| 86 |
def main():
|
| 87 |
-
|
| 88 |
-
st.title("📄 Chat with Your Document using Gemini (Sayandip+Dhiraj+Fazal)")
|
| 89 |
-
|
| 90 |
if "conversation" not in st.session_state:
|
| 91 |
st.session_state.conversation = []
|
| 92 |
if "document_text" not in st.session_state:
|
| 93 |
st.session_state.document_text = ""
|
| 94 |
if "chat_active" not in st.session_state:
|
| 95 |
st.session_state.chat_active = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
uploaded_files = st.file_uploader(
|
| 98 |
"Upload one or more documents or images",
|
|
@@ -187,7 +190,7 @@ def main():
|
|
| 187 |
st.download_button(
|
| 188 |
label="📥 Download Cleaned Conversation as PDF",
|
| 189 |
data=f,
|
| 190 |
-
file_name="
|
| 191 |
mime="application/pdf"
|
| 192 |
)
|
| 193 |
|
|
|
|
| 84 |
return pdf_path
|
| 85 |
|
| 86 |
def main():
|
| 87 |
+
# Initialize session state variables
|
|
|
|
|
|
|
| 88 |
if "conversation" not in st.session_state:
|
| 89 |
st.session_state.conversation = []
|
| 90 |
if "document_text" not in st.session_state:
|
| 91 |
st.session_state.document_text = ""
|
| 92 |
if "chat_active" not in st.session_state:
|
| 93 |
st.session_state.chat_active = True
|
| 94 |
+
if "chat_history" not in st.session_state:
|
| 95 |
+
st.session_state.chat_history = [] # Initialize chat history
|
| 96 |
+
|
| 97 |
+
st.set_page_config(page_title="Gemini Chat QA", layout="wide")
|
| 98 |
+
st.title("📄 Chat with Your Document using Gemini (Sayandip+Dhiraj+Fazal)")
|
| 99 |
|
| 100 |
uploaded_files = st.file_uploader(
|
| 101 |
"Upload one or more documents or images",
|
|
|
|
| 190 |
st.download_button(
|
| 191 |
label="📥 Download Cleaned Conversation as PDF",
|
| 192 |
data=f,
|
| 193 |
+
file_name="clean_conversation.pdf",
|
| 194 |
mime="application/pdf"
|
| 195 |
)
|
| 196 |
|