Spaces:
Restarting
on
Zero
Restarting
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ REPO_ID = "ray-006/model-audio"
|
|
| 12 |
checkpoint_path = hf_hub_download(repo_id=REPO_ID, filename="checkpoint.pt")
|
| 13 |
|
| 14 |
# 4. Load the model and apply your weights
|
| 15 |
-
model = SAMAudio.from_pretrained("
|
| 16 |
|
| 17 |
# Load your custom weights into the model
|
| 18 |
state_dict = torch.load(checkpoint_path, map_location=device)
|
|
@@ -20,7 +20,7 @@ model.load_state_dict(state_dict)
|
|
| 20 |
model.eval()
|
| 21 |
|
| 22 |
# Load processor (can be from the base or your repo if you uploaded config there)
|
| 23 |
-
processor = SAMAudioProcessor.from_pretrained("
|
| 24 |
|
| 25 |
def separate_audio(audio_path, description, reranking_candidates):
|
| 26 |
if audio_path is None or not description:
|
|
|
|
| 12 |
checkpoint_path = hf_hub_download(repo_id=REPO_ID, filename="checkpoint.pt")
|
| 13 |
|
| 14 |
# 4. Load the model and apply your weights
|
| 15 |
+
model = SAMAudio.from_pretrained("ray-006/model-audio").to(device)
|
| 16 |
|
| 17 |
# Load your custom weights into the model
|
| 18 |
state_dict = torch.load(checkpoint_path, map_location=device)
|
|
|
|
| 20 |
model.eval()
|
| 21 |
|
| 22 |
# Load processor (can be from the base or your repo if you uploaded config there)
|
| 23 |
+
processor = SAMAudioProcessor.from_pretrained("ray-006/model-audio")
|
| 24 |
|
| 25 |
def separate_audio(audio_path, description, reranking_candidates):
|
| 26 |
if audio_path is None or not description:
|