fomext commited on
Commit
d801d20
·
verified ·
1 Parent(s): d327b90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -34,17 +34,18 @@ def load_pipeline():
34
  if pipe is None:
35
  print("Loading Stable Audio Open pipeline...")
36
 
37
- # Authenticate inside Space
38
- token = os.environ.get("HF_TOKEN")
39
- if token:
40
- login(token=token)
 
41
 
42
- pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-audio-open-1.0",torch_dtype=DTYPE,trust_remote_code=True)
 
43
 
44
  print("Pipeline loaded on", DEVICE)
45
 
46
 
47
-
48
  @app.on_event("startup")
49
  def startup():
50
  load_pipeline()
 
34
  if pipe is None:
35
  print("Loading Stable Audio Open pipeline...")
36
 
37
+ pipe = DiffusionPipeline.from_pretrained(
38
+ "stabilityai/stable-audio-open-1.0",
39
+ torch_dtype=DTYPE,
40
+ trust_remote_code=True,
41
+ )
42
 
43
+ pipe.to(DEVICE)
44
+ pipe.set_progress_bar_config(disable=True)
45
 
46
  print("Pipeline loaded on", DEVICE)
47
 
48
 
 
49
  @app.on_event("startup")
50
  def startup():
51
  load_pipeline()