Update app.py
Browse files
app.py
CHANGED
|
@@ -27,6 +27,19 @@ from reportlab.pdfgen import canvas
|
|
| 27 |
from reportlab.lib.utils import ImageReader
|
| 28 |
import fitz # PyMuPDF
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
# Conditional imports for optional/heavy libraries
|
| 31 |
try:
|
| 32 |
import torch
|
|
@@ -63,19 +76,6 @@ class LogCaptureHandler(logging.Handler):
|
|
| 63 |
log_records.append(record)
|
| 64 |
logger.addHandler(LogCaptureHandler())
|
| 65 |
|
| 66 |
-
# --- App Configuration (Choose one, adapted from App 2) ---
|
| 67 |
-
st.set_page_config(
|
| 68 |
-
page_title="Vision & Layout Titans ๐๐ผ๏ธ",
|
| 69 |
-
page_icon="๐ค",
|
| 70 |
-
layout="wide",
|
| 71 |
-
initial_sidebar_state="expanded",
|
| 72 |
-
menu_items={
|
| 73 |
-
'Get Help': 'https://huggingface.co/awacke1',
|
| 74 |
-
'Report a Bug': 'https://huggingface.co/spaces/awacke1',
|
| 75 |
-
'About': "Combined App: Image->PDF Layout + AI Vision & SFT Titans ๐"
|
| 76 |
-
}
|
| 77 |
-
)
|
| 78 |
-
|
| 79 |
# --- Session State Initialization (Combined) -------------
|
| 80 |
# From App 1
|
| 81 |
st.session_state.setdefault('layout_snapshots', []) # Renamed to avoid potential conflict
|
|
|
|
| 27 |
from reportlab.lib.utils import ImageReader
|
| 28 |
import fitz # PyMuPDF
|
| 29 |
|
| 30 |
+
# --- App Configuration (Choose one, adapted from App 2) ---
|
| 31 |
+
st.set_page_config(
|
| 32 |
+
page_title="Vision & Layout Titans ๐๐ผ๏ธ",
|
| 33 |
+
page_icon="๐ค",
|
| 34 |
+
layout="wide",
|
| 35 |
+
initial_sidebar_state="expanded",
|
| 36 |
+
menu_items={
|
| 37 |
+
'Get Help': 'https://huggingface.co/awacke1',
|
| 38 |
+
'Report a Bug': 'https://huggingface.co/spaces/awacke1',
|
| 39 |
+
'About': "Combined App: Image->PDF Layout + AI Vision & SFT Titans ๐"
|
| 40 |
+
}
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
# Conditional imports for optional/heavy libraries
|
| 44 |
try:
|
| 45 |
import torch
|
|
|
|
| 76 |
log_records.append(record)
|
| 77 |
logger.addHandler(LogCaptureHandler())
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
# --- Session State Initialization (Combined) -------------
|
| 80 |
# From App 1
|
| 81 |
st.session_state.setdefault('layout_snapshots', []) # Renamed to avoid potential conflict
|