harp-dev Claude Opus 5.5 commited on
Commit
30f2487
·
verified ·
1 Parent(s): 64bb8a5

Move the model card ahead of the model loading

Browse files

Follows the layout of docs/DEPLOYMENT.md, which puts the card after the imports and before the loading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -13,12 +13,6 @@ from stable_audio_runtime import edit_audio, load_model
13
  MIN_AUDIO_SECONDS = 5
14
  MAX_AUDIO_SECONDS = 30
15
 
16
- # pyharp runs process_fn in a worker, which imports this file as __mp_main__ and starts with the
17
- # server. stable-audio-tools is installed and the model downloaded, built and placed there, on the
18
- # worker's main thread, so that no request does any of it inside its GPU reservation.
19
- if __name__ != "__main__":
20
- load_model()
21
-
22
  model_card = ModelCard(
23
  name="Stable Audio 3",
24
  description=(
@@ -31,6 +25,13 @@ model_card = ModelCard(
31
  )
32
 
33
 
 
 
 
 
 
 
 
34
  def _audio_duration(path: str | None) -> float:
35
  if not path:
36
  raise gr.Error("Please upload a music clip.")
 
13
  MIN_AUDIO_SECONDS = 5
14
  MAX_AUDIO_SECONDS = 30
15
 
 
 
 
 
 
 
16
  model_card = ModelCard(
17
  name="Stable Audio 3",
18
  description=(
 
25
  )
26
 
27
 
28
+ # pyharp runs process_fn in a worker, which imports this file as __mp_main__ and starts with the
29
+ # server. stable-audio-tools is installed and the model downloaded, built and placed there, on the
30
+ # worker's main thread, so that no request does any of it inside its GPU reservation.
31
+ if __name__ != "__main__":
32
+ load_model()
33
+
34
+
35
  def _audio_duration(path: str | None) -> float:
36
  if not path:
37
  raise gr.Error("Please upload a music clip.")