harp-dev commited on
Commit
3fabe0a
·
verified ·
1 Parent(s): ddc2d14

Take app.py from the pyharp example

Browse files
Files changed (1) hide show
  1. app.py +14 -13
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
- "Exercises every input control, track type, and output label type "
40
- "supported by HARP. No real processing is performed: input tracks are "
41
- "passed through unchanged, and bundled reference media is substituted for "
42
- "any track left empty, so the app can be run without loading anything. "
43
- "The control values are echoed into the output label descriptions. "
44
- "Repository: https://github.com/TEAMuP-dev/pyharp"
45
  )
46
  ),
47
- author="TEAMuP",
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; 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,8 +233,9 @@ def process_fn(
233
  return output_audio_path, output_midi_path, output_labels, output_file_path
234
 
235
 
236
- # Build the Gradio endpoint
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