feat: add --bars arg to control output length
generate_period() now accepts n_bars=N to stop after exactly N complete bars. bars_completed is seeded from the prefix length so --bars counts the full output, not just the generated tail. scripts/generate.py exposes this as --bars (default: None = model decides). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -89,6 +89,8 @@ def main() -> None:
|
||||
help="Nucleus sampling cutoff (default: 0.9).")
|
||||
ap.add_argument("--max-tokens", type=int, default=300, dest="max_tokens",
|
||||
help="Hard cap on generated tokens (default: 300).")
|
||||
ap.add_argument("--bars", type=int, default=None,
|
||||
help="Stop after this many complete bars (default: let the model decide).")
|
||||
ap.add_argument("--seed", type=int, default=None,
|
||||
help="Random seed for reproducibility.")
|
||||
ap.add_argument("--tempo", type=int, default=90,
|
||||
@@ -136,6 +138,7 @@ def main() -> None:
|
||||
temperature=args.temperature,
|
||||
top_p=args.top_p,
|
||||
max_tokens=args.max_tokens,
|
||||
n_bars=args.bars,
|
||||
seed=args.seed,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user