multimodalart HF Staff commited on
Commit
61801ee
·
verified ·
1 Parent(s): b4ac5f7

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +6 -0
  2. app.py +15 -2
  3. requirements.txt +0 -1
README.md CHANGED
@@ -51,5 +51,11 @@ of [tidalove/cfc-track-instruction](https://huggingface.co/datasets/tidalove/cfc
51
  - Runs on ZeroGPU; the model is loaded in bfloat16 (~16 GB VRAM).
52
  - Video is sampled at 2 FPS, max 128 frames, per the model's
53
  `video_preprocessor_config.json`.
 
 
 
 
 
 
54
  - A truncated answer (no closing `</tracks>`) means you hit the *Max new tokens* cap —
55
  raise it in **Advanced**.
 
51
  - Runs on ZeroGPU; the model is loaded in bfloat16 (~16 GB VRAM).
52
  - Video is sampled at 2 FPS, max 128 frames, per the model's
53
  `video_preprocessor_config.json`.
54
+ - The released checkpoint ships a config mismatch: `processor_config.json` sets
55
+ `use_frame_special_tokens: true` (so each frame is wrapped in
56
+ `<frame_start>`/`<frame_end>`, matching training) while `config.json` sets it
57
+ `false`, which makes the model count `<im_end>` instead and abort with
58
+ `AssertionError: Expected 0 videos, but got 1`. `app.py` aligns the two at
59
+ load time.
60
  - A truncated answer (no closing `</tracks>`) means you hit the *Max new tokens* cap —
61
  raise it in **Advanced**.
app.py CHANGED
@@ -248,7 +248,20 @@ def _infer(video_path: str, turns: list, max_new_tokens: int):
248
  # --------------------------------------------------------------------------- #
249
  # Gradio handlers
250
  # --------------------------------------------------------------------------- #
251
- @spaces.GPU(duration=140)
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  def track_fish(
253
  video_path: str,
254
  correction_hint: str = "",
@@ -271,7 +284,7 @@ def track_fish(
271
  return _infer(video_path, [(DEFAULT_PROMPT, None)], int(max_new_tokens))
272
 
273
 
274
- @spaces.GPU(duration=140)
275
  def refine_tracks(
276
  video_path: str,
277
  previous_tracks: str,
 
248
  # --------------------------------------------------------------------------- #
249
  # Gradio handlers
250
  # --------------------------------------------------------------------------- #
251
+ # Measured on ZeroGPU: ~29 s for ~800 generated tokens, ~48 s for ~1600, plus
252
+ # ~10 s to render the overlay. Runtime is dominated by decoding, so scale the
253
+ # GPU reservation with the token budget instead of over-booking a flat number.
254
+ def _track_duration(video_path=None, correction_hint="", max_new_tokens=1600,
255
+ progress=None) -> int:
256
+ return int(25 + 0.028 * int(max_new_tokens or 1600))
257
+
258
+
259
+ def _refine_duration(video_path=None, previous_tracks="", correction="",
260
+ max_new_tokens=1600, progress=None) -> int:
261
+ return int(25 + 0.028 * int(max_new_tokens or 1600))
262
+
263
+
264
+ @spaces.GPU(duration=_track_duration)
265
  def track_fish(
266
  video_path: str,
267
  correction_hint: str = "",
 
284
  return _infer(video_path, [(DEFAULT_PROMPT, None)], int(max_new_tokens))
285
 
286
 
287
+ @spaces.GPU(duration=_refine_duration)
288
  def refine_tracks(
289
  video_path: str,
290
  previous_tracks: str,
requirements.txt CHANGED
@@ -1,6 +1,5 @@
1
  transformers==4.57.6
2
  accelerate
3
- molmo_utils
4
  torchvision
5
  av
6
  decord
 
1
  transformers==4.57.6
2
  accelerate
 
3
  torchvision
4
  av
5
  decord