Spaces:
Running
Running
Take app.py from the pyharp example
Browse files
app.py
CHANGED
|
@@ -34,18 +34,18 @@ REFERENCE_MIDI_PATH = os.path.join(RESOURCE_DIR, "test.mid")
|
|
| 34 |
# Metadata shown in HARP's model info panel
|
| 35 |
model_card = ModelCard(
|
| 36 |
name="UI Tester",
|
|
|
|
| 37 |
description=(
|
| 38 |
(
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
)
|
| 46 |
),
|
| 47 |
-
|
| 48 |
-
tags=[Category.UTILITY, 'example', 'test'],
|
| 49 |
)
|
| 50 |
|
| 51 |
|
|
@@ -168,10 +168,10 @@ def process_fn(
|
|
| 168 |
input_midi_path (Optional[str]): MIDI track, or None if left empty.
|
| 169 |
input_file_path (Optional[str]): Generic file, or None if left empty.
|
| 170 |
processing_delay (float): Seconds to sleep, to test HARP's cancel button.
|
| 171 |
-
gain (float): Unused
|
| 172 |
-
repetitions (float): Unused
|
| 173 |
-
mode (str): Unused
|
| 174 |
-
effects (list): Unused
|
| 175 |
enable_audio_labels (bool): Whether to emit labels over the audio.
|
| 176 |
enable_midi_labels (bool): Whether to emit labels over the MIDI.
|
| 177 |
text_prompt (str): Written to the output file when no input file is given.
|
|
@@ -233,8 +233,9 @@ def process_fn(
|
|
| 233 |
return output_audio_path, output_midi_path, output_labels, output_file_path
|
| 234 |
|
| 235 |
|
| 236 |
-
#
|
| 237 |
if __name__ == "__main__":
|
|
|
|
| 238 |
with gr.Blocks() as demo:
|
| 239 |
# Audio and MIDI components become tracks in HARP. A gr.File with any
|
| 240 |
# other extension becomes a GUI file picker instead. Every input here is
|
|
|
|
| 34 |
# Metadata shown in HARP's model info panel
|
| 35 |
model_card = ModelCard(
|
| 36 |
name="UI Tester",
|
| 37 |
+
author="TEAMuP",
|
| 38 |
description=(
|
| 39 |
(
|
| 40 |
+
"Exercises every input control, track type, and output label type "
|
| 41 |
+
"supported by HARP. No real processing is performed: input tracks are "
|
| 42 |
+
"passed through unchanged, and bundled reference media is substituted "
|
| 43 |
+
"for any track left empty, so the app can be run without loading "
|
| 44 |
+
"anything. The control values are echoed into the output label "
|
| 45 |
+
"descriptions. Repository: https://github.com/TEAMuP-dev/pyharp"
|
| 46 |
)
|
| 47 |
),
|
| 48 |
+
tags=[Category.UTILITY, "example", "test"],
|
|
|
|
| 49 |
)
|
| 50 |
|
| 51 |
|
|
|
|
| 168 |
input_midi_path (Optional[str]): MIDI track, or None if left empty.
|
| 169 |
input_file_path (Optional[str]): Generic file, or None if left empty.
|
| 170 |
processing_delay (float): Seconds to sleep, to test HARP's cancel button.
|
| 171 |
+
gain (float): Unused. Demonstrates a fractional slider.
|
| 172 |
+
repetitions (float): Unused. Demonstrates a number box.
|
| 173 |
+
mode (str): Unused. Demonstrates a dropdown.
|
| 174 |
+
effects (list): Unused. Demonstrates a multiple-selection dropdown.
|
| 175 |
enable_audio_labels (bool): Whether to emit labels over the audio.
|
| 176 |
enable_midi_labels (bool): Whether to emit labels over the MIDI.
|
| 177 |
text_prompt (str): Written to the output file when no input file is given.
|
|
|
|
| 233 |
return output_audio_path, output_midi_path, output_labels, output_file_path
|
| 234 |
|
| 235 |
|
| 236 |
+
# The processing worker imports this file, so the app must not be built there
|
| 237 |
if __name__ == "__main__":
|
| 238 |
+
# Build the Gradio endpoint
|
| 239 |
with gr.Blocks() as demo:
|
| 240 |
# Audio and MIDI components become tracks in HARP. A gr.File with any
|
| 241 |
# other extension becomes a GUI file picker instead. Every input here is
|