victor HF Staff commited on
Commit
2b4941c
·
verified ·
1 Parent(s): d9f8a47

Fix Marlin processor deps and cached examples

Browse files
Files changed (2) hide show
  1. app.py +13 -10
  2. requirements.txt +1 -0
app.py CHANGED
@@ -222,7 +222,7 @@ main, .gradio-container, .contain {
222
  """
223
 
224
 
225
- with gr.Blocks(title="Marlin-2B Video Understanding", css=css, fill_width=True) as demo:
226
  gr.Markdown("# Marlin-2B Video Understanding")
227
  gr.Markdown(LOAD_STATUS)
228
 
@@ -245,14 +245,6 @@ with gr.Blocks(title="Marlin-2B Video Understanding", css=css, fill_width=True)
245
  label="Caption token cap",
246
  )
247
  run_btn = gr.Button("Analyze Video", variant="primary")
248
- gr.Examples(
249
- examples=EXAMPLES,
250
- inputs=[video_in, task_in, event_in, max_tokens_in, temperature_in],
251
- label="Examples",
252
- examples_per_page=3,
253
- cache_examples=True,
254
- cache_mode="lazy",
255
- )
256
 
257
  with gr.Column(scale=7, min_width=360):
258
  timeline_out = gr.Image(type="pil", label="Timeline", height=240)
@@ -276,5 +268,16 @@ with gr.Blocks(title="Marlin-2B Video Understanding", css=css, fill_width=True)
276
  api_name="analyze",
277
  )
278
 
 
 
 
 
 
 
 
 
 
 
 
279
 
280
- demo.queue(max_size=12, default_concurrency_limit=1).launch(ssr_mode=False)
 
222
  """
223
 
224
 
225
+ with gr.Blocks(title="Marlin-2B Video Understanding", fill_width=True) as demo:
226
  gr.Markdown("# Marlin-2B Video Understanding")
227
  gr.Markdown(LOAD_STATUS)
228
 
 
245
  label="Caption token cap",
246
  )
247
  run_btn = gr.Button("Analyze Video", variant="primary")
 
 
 
 
 
 
 
 
248
 
249
  with gr.Column(scale=7, min_width=360):
250
  timeline_out = gr.Image(type="pil", label="Timeline", height=240)
 
268
  api_name="analyze",
269
  )
270
 
271
+ gr.Examples(
272
+ examples=EXAMPLES,
273
+ inputs=[video_in, task_in, event_in, max_tokens_in, temperature_in],
274
+ outputs=[scene_out, events_out, span_out, timeline_out, raw_out, status_out],
275
+ fn=analyze,
276
+ label="Examples",
277
+ examples_per_page=3,
278
+ cache_examples=True,
279
+ cache_mode="lazy",
280
+ )
281
+
282
 
283
+ demo.queue(max_size=12, default_concurrency_limit=1).launch(ssr_mode=False, css=css)
requirements.txt CHANGED
@@ -4,6 +4,7 @@ hf-transfer
4
  accelerate>=1.10.0
5
  transformers>=5.7.0
6
  torchcodec
 
7
  qwen-vl-utils>=0.0.14
8
  av
9
  pillow
 
4
  accelerate>=1.10.0
5
  transformers>=5.7.0
6
  torchcodec
7
+ torchvision
8
  qwen-vl-utils>=0.0.14
9
  av
10
  pillow