futurefantasy commited on
Commit
a9ae4f8
·
verified ·
1 Parent(s): adc84f9

Update quick_start output behavior and trim README args

Browse files
README.md CHANGED
@@ -60,9 +60,9 @@ python quick_start/run_example.py \
60
  - `--task-instruction`: task description, unless `--prompt` is used instead.
61
  - `--task-plan`: optional step-by-step plan text for the default `chunk_all` prompt.
62
  - `--model-path`: optional. Defaults to the parent directory of `quick_start/`.
63
- - `--output-jsonl`: optional. Defaults to `quick_start/outputs/<video_stem>.jsonl`.
64
  - `--prompt`: optional full prompt override.
65
- - `--sample-hz`, `--max-new-tokens`: optional inference controls.
66
 
67
  Render a prediction-only preview video from the JSONL output:
68
 
 
60
  - `--task-instruction`: task description, unless `--prompt` is used instead.
61
  - `--task-plan`: optional step-by-step plan text for the default `chunk_all` prompt.
62
  - `--model-path`: optional. Defaults to the parent directory of `quick_start/`.
63
+ - `--output-jsonl`: optional. If omitted, the script prints the prediction only and does not save a JSONL file.
64
  - `--prompt`: optional full prompt override.
65
+ - `--sample-hz`: optional inference control. Default: `2.0`.
66
 
67
  Render a prediction-only preview video from the JSONL output:
68
 
quick_start/README.md CHANGED
@@ -36,9 +36,8 @@ Important arguments:
36
  - `--task-instruction`: optional if `--prompt` is provided. Natural-language task description.
37
  - `--task-plan`: optional. Multi-line plan text appended after `--task-instruction` when building the default `chunk_all` prompt.
38
  - `--model-path`: optional. Defaults to the parent directory of `quick_start/`.
39
- - `--output-jsonl`: optional. Defaults to `quick_start/outputs/<video_stem>.jsonl`.
40
  - `--sample-hz`: optional. Video sampling rate for inference. Default: `2.0`.
41
- - `--max-new-tokens`: optional. Generation cap. Default: `1024`.
42
  - `--prompt`: optional full prompt override. If set, `--task-instruction` and `--task-plan` are ignored.
43
 
44
  Render a preview video:
 
36
  - `--task-instruction`: optional if `--prompt` is provided. Natural-language task description.
37
  - `--task-plan`: optional. Multi-line plan text appended after `--task-instruction` when building the default `chunk_all` prompt.
38
  - `--model-path`: optional. Defaults to the parent directory of `quick_start/`.
39
+ - `--output-jsonl`: optional. If omitted, the script prints the prediction only and does not save a JSONL file.
40
  - `--sample-hz`: optional. Video sampling rate for inference. Default: `2.0`.
 
41
  - `--prompt`: optional full prompt override. If set, `--task-instruction` and `--task-plan` are ignored.
42
 
43
  Render a preview video:
quick_start/run_example.py CHANGED
@@ -68,7 +68,7 @@ def parse_args() -> argparse.Namespace:
68
  "--output-jsonl",
69
  type=Path,
70
  default=None,
71
- help="Optional output path. Defaults to quick_start/outputs/<video_stem>.jsonl",
72
  )
73
  parser.add_argument(
74
  "--max-new-tokens",
@@ -282,8 +282,9 @@ def main() -> int:
282
  prompt, prompt_source, task_instruction, task_plan = resolve_prompt(args)
283
  video_path = resolve_video_path(args.video_path)
284
  video_path_for_output = maybe_relativize_to_model_root(video_path)
285
- output_path = args.output_jsonl or (THIS_DIR / "outputs" / f"{video_path.stem}.jsonl")
286
- output_path.parent.mkdir(parents=True, exist_ok=True)
 
287
 
288
  InferRequest, PtEngine, RequestConfig = load_swift_runtime()
289
  engine = PtEngine(
@@ -341,10 +342,11 @@ def main() -> int:
341
  "pred_curve_point_progress": pred_point_progress,
342
  }
343
  )
344
- output_path.write_text(json.dumps(output_row, ensure_ascii=False) + "\n", encoding="utf-8")
 
345
 
346
  print(f"video_path={video_path}")
347
- print(f"output_jsonl={output_path.resolve()}")
348
  print(f"input_sample_hz={float(args.sample_hz):.4f}")
349
  print(f"input_frame_count={len(sampled_indices)}")
350
  print(f"pred_keypoint_count={len(pred_point_progress)}")
 
68
  "--output-jsonl",
69
  type=Path,
70
  default=None,
71
+ help="Optional output path. If omitted, print the response only and do not save a JSONL file.",
72
  )
73
  parser.add_argument(
74
  "--max-new-tokens",
 
282
  prompt, prompt_source, task_instruction, task_plan = resolve_prompt(args)
283
  video_path = resolve_video_path(args.video_path)
284
  video_path_for_output = maybe_relativize_to_model_root(video_path)
285
+ output_path = args.output_jsonl.resolve() if args.output_jsonl is not None else None
286
+ if output_path is not None:
287
+ output_path.parent.mkdir(parents=True, exist_ok=True)
288
 
289
  InferRequest, PtEngine, RequestConfig = load_swift_runtime()
290
  engine = PtEngine(
 
342
  "pred_curve_point_progress": pred_point_progress,
343
  }
344
  )
345
+ if output_path is not None:
346
+ output_path.write_text(json.dumps(output_row, ensure_ascii=False) + "\n", encoding="utf-8")
347
 
348
  print(f"video_path={video_path}")
349
+ print(f"output_jsonl={output_path if output_path is not None else '(not saved)'}")
350
  print(f"input_sample_hz={float(args.sample_hz):.4f}")
351
  print(f"input_frame_count={len(sampled_indices)}")
352
  print(f"pred_keypoint_count={len(pred_point_progress)}")