Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stable_audio_tools/interface/gradio.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def create_ui(model_config_path=None, ckpt_path=None, pretrained_name=None, pret
else:
model_config = None

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
device = torch.device("cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu")
_, model_config = load_model(model_config, ckpt_path, pretrained_name=pretrained_name, pretransform_ckpt_path=pretransform_ckpt_path, model_half=model_half, device=device)

if model_type == "diffusion_cond" or model_type == "diffusion_cond_inpaint":
Expand All @@ -375,4 +375,4 @@ def create_ui(model_config_path=None, ckpt_path=None, pretrained_name=None, pret
elif model_type == "lm":
ui = create_lm_ui(model_config)

return ui
return ui
4 changes: 2 additions & 2 deletions stable_audio_tools/models/conditioners.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def __init__(self,
project_out: bool = False):
super().__init__(512, output_dim, project_out=project_out)

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
device = torch.device('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')

# Suppress logging from transformers
previous_level = logging.root.manager.disable
Expand Down Expand Up @@ -758,4 +758,4 @@ def create_multi_conditioner_from_conditioning_config(config: tp.Dict[str, tp.An
else:
raise ValueError(f"Unknown conditioner type: {conditioner_type}")

return MultiConditioner(conditioners, default_keys=default_keys, pre_encoded_keys=pre_encoded_keys)
return MultiConditioner(conditioners, default_keys=default_keys, pre_encoded_keys=pre_encoded_keys)