Spaces:
Sleeping
Sleeping
Update src/app.py
Browse files- src/app.py +0 -23
src/app.py
CHANGED
|
@@ -129,7 +129,6 @@ if uploaded_file is not None:
|
|
| 129 |
|
| 130 |
st.success(f"β
File saved: {uploaded_file.name}")
|
| 131 |
|
| 132 |
-
# Parse PDF
|
| 133 |
if st.button("π Parse PDF"):
|
| 134 |
if not st.session_state.api_key_set:
|
| 135 |
st.error("β Please set OpenAI API key first")
|
|
@@ -159,7 +158,6 @@ if uploaded_file is not None:
|
|
| 159 |
with col3:
|
| 160 |
st.metric("π Tables", len(tables))
|
| 161 |
|
| 162 |
-
# Show image OCR details
|
| 163 |
#if images:
|
| 164 |
# st.subheader("πΌοΈ Extracted Images")
|
| 165 |
# for idx, img in enumerate(images):
|
|
@@ -208,7 +206,6 @@ if st.button("πΌοΈ Analyze & Store Components"):
|
|
| 208 |
|
| 209 |
st.session_state.processing_results = results
|
| 210 |
|
| 211 |
-
# Display results
|
| 212 |
st.success("β
Visual analysis complete & stored!")
|
| 213 |
|
| 214 |
col1, col2, col3 = st.columns(3)
|
|
@@ -221,7 +218,6 @@ if st.button("πΌοΈ Analyze & Store Components"):
|
|
| 221 |
|
| 222 |
st.metric("π Total Stored in Vector", results['total_stored'])
|
| 223 |
|
| 224 |
-
# Show image visual analyses
|
| 225 |
#if results['image_visual_analyses']:
|
| 226 |
# st.subheader("πΌοΈ Visual Image Analyses (gpt-4o)")
|
| 227 |
# for img_analysis in results['image_visual_analyses']:
|
|
@@ -236,7 +232,6 @@ if st.button("πΌοΈ Analyze & Store Components"):
|
|
| 236 |
# st.write("**OCR Text (backup):**")
|
| 237 |
# st.text(img_analysis['ocr_text'][:500])
|
| 238 |
|
| 239 |
-
# Show text chunk summaries
|
| 240 |
#if results['text_summaries']:
|
| 241 |
# st.subheader("π Text Chunk Summaries")
|
| 242 |
# for chunk_summary in results['text_summaries']:
|
|
@@ -249,7 +244,6 @@ if st.button("πΌοΈ Analyze & Store Components"):
|
|
| 249 |
# st.write("**Original Text (first 500 chars):**")
|
| 250 |
# st.text(chunk_summary['original_text'])
|
| 251 |
|
| 252 |
-
# Show table analyses
|
| 253 |
#if results['table_summaries']:
|
| 254 |
# st.subheader("π Table Analyses")
|
| 255 |
# for table_summary in results['table_summaries']:
|
|
@@ -358,20 +352,3 @@ if st.button("π Search & Generate Answer"):
|
|
| 358 |
|
| 359 |
st.divider()
|
| 360 |
|
| 361 |
-
#col1, col2, col3 = st.columns(3)
|
| 362 |
-
|
| 363 |
-
#with col1:
|
| 364 |
-
# st.info("π **Text Processing**: PyPDF2 extraction with UTF-8 support")
|
| 365 |
-
|
| 366 |
-
#with col2:
|
| 367 |
-
# st.info("πΌοΈ **Visual Analysis**: GPT-4o vision for image understanding")
|
| 368 |
-
|
| 369 |
-
#with col3:
|
| 370 |
-
# st.info("π **Vector Storage**: ChromaDB with auto-persist")
|
| 371 |
-
|
| 372 |
-
#st.caption(
|
| 373 |
-
# "Multimodal RAG System | "
|
| 374 |
-
# "Visual Image Analysis | "
|
| 375 |
-
# "Russian Language Support | "
|
| 376 |
-
# "Individual Component Summarization"
|
| 377 |
-
#)
|
|
|
|
| 129 |
|
| 130 |
st.success(f"β
File saved: {uploaded_file.name}")
|
| 131 |
|
|
|
|
| 132 |
if st.button("π Parse PDF"):
|
| 133 |
if not st.session_state.api_key_set:
|
| 134 |
st.error("β Please set OpenAI API key first")
|
|
|
|
| 158 |
with col3:
|
| 159 |
st.metric("π Tables", len(tables))
|
| 160 |
|
|
|
|
| 161 |
#if images:
|
| 162 |
# st.subheader("πΌοΈ Extracted Images")
|
| 163 |
# for idx, img in enumerate(images):
|
|
|
|
| 206 |
|
| 207 |
st.session_state.processing_results = results
|
| 208 |
|
|
|
|
| 209 |
st.success("β
Visual analysis complete & stored!")
|
| 210 |
|
| 211 |
col1, col2, col3 = st.columns(3)
|
|
|
|
| 218 |
|
| 219 |
st.metric("π Total Stored in Vector", results['total_stored'])
|
| 220 |
|
|
|
|
| 221 |
#if results['image_visual_analyses']:
|
| 222 |
# st.subheader("πΌοΈ Visual Image Analyses (gpt-4o)")
|
| 223 |
# for img_analysis in results['image_visual_analyses']:
|
|
|
|
| 232 |
# st.write("**OCR Text (backup):**")
|
| 233 |
# st.text(img_analysis['ocr_text'][:500])
|
| 234 |
|
|
|
|
| 235 |
#if results['text_summaries']:
|
| 236 |
# st.subheader("π Text Chunk Summaries")
|
| 237 |
# for chunk_summary in results['text_summaries']:
|
|
|
|
| 244 |
# st.write("**Original Text (first 500 chars):**")
|
| 245 |
# st.text(chunk_summary['original_text'])
|
| 246 |
|
|
|
|
| 247 |
#if results['table_summaries']:
|
| 248 |
# st.subheader("π Table Analyses")
|
| 249 |
# for table_summary in results['table_summaries']:
|
|
|
|
| 352 |
|
| 353 |
st.divider()
|
| 354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|