Spaces:
Running
Running
burtenshaw
commited on
Commit
·
d19c5e3
1
Parent(s):
dfd0eac
fix line breaks
Browse files- app/app.py +20 -18
app/app.py
CHANGED
@@ -1102,7 +1102,7 @@ with gr.Blocks(
|
|
1102 |
)
|
1103 |
with gr.Column(scale=4):
|
1104 |
gr.Markdown(
|
1105 |
-
"### Instructions
|
1106 |
)
|
1107 |
|
1108 |
# Tab 2: Build Slides
|
@@ -1118,7 +1118,7 @@ with gr.Blocks(
|
|
1118 |
)
|
1119 |
with gr.Column(scale=4):
|
1120 |
gr.Markdown(
|
1121 |
-
"### Instructions
|
1122 |
)
|
1123 |
|
1124 |
# Tab 3: Generate Audio
|
@@ -1131,8 +1131,7 @@ with gr.Blocks(
|
|
1131 |
)
|
1132 |
with gr.Column(scale=4):
|
1133 |
gr.Markdown(
|
1134 |
-
"### Instructions
|
1135 |
-
)
|
1136 |
|
1137 |
# Tab 4: Generate Video
|
1138 |
with gr.TabItem("4. Create Video", id=3):
|
@@ -1144,14 +1143,26 @@ with gr.Blocks(
|
|
1144 |
)
|
1145 |
with gr.Column(scale=4):
|
1146 |
gr.Markdown(
|
1147 |
-
"### Instructions
|
|
|
|
|
1148 |
)
|
1149 |
video_output = gr.Video(label="Final Video", visible=False)
|
1150 |
|
1151 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1152 |
slide_editors_group = []
|
1153 |
with gr.Column(visible=False) as editor_column: # Initially hidden
|
1154 |
-
gr.Markdown("---
|
1155 |
gr.Markdown("_(PDF uses content & notes, Audio uses notes only)_")
|
1156 |
for i in range(MAX_SLIDES):
|
1157 |
with gr.Accordion(f"Slide {i + 1}", open=(i == 0), visible=False) as acc:
|
@@ -1209,16 +1220,6 @@ with gr.Blocks(
|
|
1209 |
show_progress="hidden",
|
1210 |
)
|
1211 |
|
1212 |
-
# --- Status Textbox (Added) ---
|
1213 |
-
with gr.Row():
|
1214 |
-
status_textbox = gr.Textbox(
|
1215 |
-
label="Status",
|
1216 |
-
value="Enter a URL and click 'Fetch & Generate' to start.",
|
1217 |
-
interactive=False,
|
1218 |
-
lines=1,
|
1219 |
-
max_lines=1,
|
1220 |
-
)
|
1221 |
-
|
1222 |
# --- Component Lists for Updates ---
|
1223 |
all_editor_components = [comp for group in slide_editors_group for comp in group]
|
1224 |
all_code_editors = [group[1] for group in slide_editors_group]
|
@@ -1256,7 +1257,8 @@ with gr.Blocks(
|
|
1256 |
if i < MAX_SLIDES
|
1257 |
for upd in [
|
1258 |
gr.update(
|
1259 |
-
|
|
|
1260 |
visible=True,
|
1261 |
open=(i == 0),
|
1262 |
), # Accordion
|
|
|
1102 |
)
|
1103 |
with gr.Column(scale=4):
|
1104 |
gr.Markdown(
|
1105 |
+
"### Instructions\n1. Enter URL & click 'Fetch & Generate'.\n2. Editor appears below.\n3. Go to next tab."
|
1106 |
)
|
1107 |
|
1108 |
# Tab 2: Build Slides
|
|
|
1118 |
)
|
1119 |
with gr.Column(scale=4):
|
1120 |
gr.Markdown(
|
1121 |
+
"### Instructions\n1. Edit content/notes below.\n2. Click 'Build Slides'. Images appear.\n3. Download PDF from sidebar.\n4. Go to next tab."
|
1122 |
)
|
1123 |
|
1124 |
# Tab 3: Generate Audio
|
|
|
1131 |
)
|
1132 |
with gr.Column(scale=4):
|
1133 |
gr.Markdown(
|
1134 |
+
"### Instructions\n1. Finalize notes below.\n2. Click 'Generate Audio'.\n3. Regenerate if needed.\n4. Go to next tab.")
|
|
|
1135 |
|
1136 |
# Tab 4: Generate Video
|
1137 |
with gr.TabItem("4. Create Video", id=3):
|
|
|
1143 |
)
|
1144 |
with gr.Column(scale=4):
|
1145 |
gr.Markdown(
|
1146 |
+
"### Instructions\n1. Click 'Create Video'.\n2. Video appears below.".replace(
|
1147 |
+
"\n", "\n"
|
1148 |
+
) # Ensure newlines are rendered
|
1149 |
)
|
1150 |
video_output = gr.Video(label="Final Video", visible=False)
|
1151 |
|
1152 |
+
# --- Status Textbox (Moved BEFORE editor_column) ---
|
1153 |
+
with gr.Row():
|
1154 |
+
status_textbox = gr.Textbox(
|
1155 |
+
label="Status",
|
1156 |
+
value="Enter a URL and click 'Fetch & Generate' to start.",
|
1157 |
+
interactive=False,
|
1158 |
+
lines=1,
|
1159 |
+
max_lines=1,
|
1160 |
+
)
|
1161 |
+
|
1162 |
+
# Define the shared editor structure once, AFTER tabs and status box
|
1163 |
slide_editors_group = []
|
1164 |
with gr.Column(visible=False) as editor_column: # Initially hidden
|
1165 |
+
gr.Markdown("--- \n## Edit Slides & Notes")
|
1166 |
gr.Markdown("_(PDF uses content & notes, Audio uses notes only)_")
|
1167 |
for i in range(MAX_SLIDES):
|
1168 |
with gr.Accordion(f"Slide {i + 1}", open=(i == 0), visible=False) as acc:
|
|
|
1220 |
show_progress="hidden",
|
1221 |
)
|
1222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1223 |
# --- Component Lists for Updates ---
|
1224 |
all_editor_components = [comp for group in slide_editors_group for comp in group]
|
1225 |
all_code_editors = [group[1] for group in slide_editors_group]
|
|
|
1257 |
if i < MAX_SLIDES
|
1258 |
for upd in [
|
1259 |
gr.update(
|
1260 |
+
# Get cleaned first line for title, then use in f-string
|
1261 |
+
label=f"Slide {i + 1}: {(slide['content'].splitlines()[0] if slide['content'] else '').strip()[:30]}...",
|
1262 |
visible=True,
|
1263 |
open=(i == 0),
|
1264 |
), # Accordion
|