Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -118,8 +118,8 @@ def main():
|
|
118 |
</style>
|
119 |
""", unsafe_allow_html=True)
|
120 |
|
121 |
-
st.title("
|
122 |
-
st.markdown("Welcome to the BSNL
|
123 |
|
124 |
if not st.session_state.authenticated:
|
125 |
st.warning("Please authenticate with your API key in the sidebar.")
|
@@ -147,7 +147,6 @@ def process_input(input_type, input_data):
|
|
147 |
documents += page.extract_text() or ""
|
148 |
else:
|
149 |
# Handle zip file
|
150 |
-
zip_path = "uploads/uploaded outrightedefault: true
|
151 |
zip_path = "uploads/uploaded.zip"
|
152 |
with open(zip_path, "wb") as f:
|
153 |
f.write(input_data.getvalue())
|
@@ -165,7 +164,7 @@ def process_input(input_type, input_data):
|
|
165 |
|
166 |
# Clean up extracted files
|
167 |
shutil.rmtree("uploads/extracted", ignore_errors=True)
|
168 |
-
os.remove
|
169 |
|
170 |
# Split text
|
171 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
|
|
|
118 |
</style>
|
119 |
""", unsafe_allow_html=True)
|
120 |
|
121 |
+
st.title("RAG Q&A App with Mistral AI")
|
122 |
+
st.markdown("Welcome to the BSNL RAG App! Upload your PDFs and ask questions with ease.", unsafe_allow_html=True)
|
123 |
|
124 |
if not st.session_state.authenticated:
|
125 |
st.warning("Please authenticate with your API key in the sidebar.")
|
|
|
147 |
documents += page.extract_text() or ""
|
148 |
else:
|
149 |
# Handle zip file
|
|
|
150 |
zip_path = "uploads/uploaded.zip"
|
151 |
with open(zip_path, "wb") as f:
|
152 |
f.write(input_data.getvalue())
|
|
|
164 |
|
165 |
# Clean up extracted files
|
166 |
shutil.rmtree("uploads/extracted", ignore_errors=True)
|
167 |
+
os.remove(zip_path)
|
168 |
|
169 |
# Split text
|
170 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
|