MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / make_generation_params

Function make_generation_params

tests/ace_step/ace_step_python_warm_bench.py:204–218  ·  view source on GitHub ↗
(request: dict[str, Any])

Source from the content-addressed store, hash-verified

202
203
204def make_generation_params(request: dict[str, Any]) -> GenerationParams:
205 kwargs = dict(request)
206 track_name = kwargs.pop("track_name", "")
207 complete_track_classes = kwargs.pop("complete_track_classes", None)
208 negative_prompt = kwargs.pop("negative_prompt", None)
209 if negative_prompt is not None and "lm_negative_prompt" not in kwargs:
210 kwargs["lm_negative_prompt"] = negative_prompt
211 if kwargs.get("task_type") == "extract" and track_name and not kwargs.get("instruction"):
212 kwargs["instruction"] = f"Extract the {track_name.upper()} track from the audio:"
213 if kwargs.get("task_type") == "lego" and track_name and not kwargs.get("instruction"):
214 kwargs["instruction"] = f"Generate the {track_name.upper()} track based on the audio context:"
215 if kwargs.get("task_type") == "complete" and complete_track_classes and not kwargs.get("instruction"):
216 track_classes = [str(item).upper() for item in complete_track_classes]
217 kwargs["instruction"] = f"Complete the input track with {' | '.join(track_classes)}:"
218 return GenerationParams(**kwargs)
219
220
221def make_generation_config(request: dict[str, Any], noise_file: str) -> GenerationConfig:

Callers 1

run_requestFunction · 0.85

Calls 2

popMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected