Spaces:
Running
Running
bugfix on 'NoneType' object has no attribute 'caption'
Browse files
app.py
CHANGED
@@ -150,9 +150,13 @@ if ctx.video_processor:
|
|
150 |
# Placeholder for showing captions
|
151 |
placeholder = st.empty()
|
152 |
if ctx.state.playing:
|
153 |
-
placeholder.markdown("**Caption:** _Waiting for inference…_")
|
154 |
while ctx.state.playing:
|
155 |
-
|
|
|
|
|
|
|
|
|
156 |
placeholder.markdown(f"**Caption:** {txt}")
|
157 |
time.sleep(0.1)
|
158 |
else:
|
|
|
150 |
# Placeholder for showing captions
|
151 |
placeholder = st.empty()
|
152 |
if ctx.state.playing:
|
153 |
+
placeholder.markdown("**Caption:** _Waiting for first inference…_")
|
154 |
while ctx.state.playing:
|
155 |
+
vp = ctx.video_processor
|
156 |
+
if vp is not None:
|
157 |
+
txt = vp.caption or "_…thinking…_"
|
158 |
+
else:
|
159 |
+
txt = "_…loading…_"
|
160 |
placeholder.markdown(f"**Caption:** {txt}")
|
161 |
time.sleep(0.1)
|
162 |
else:
|