{
"mix_file": "https://replicate.delivery/mgxm/37dba301-948f-493d-89d6-7adacb8160ad/SevenNationArmy_trimmed.mp3",
"query_file": "https://replicate.delivery/mgxm/2362d82d-d016-445d-b9e2-b99f3e3f70ac/bass.wav"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_7Am**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run retrocirce/zero_shot_audio_source_separation using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"retrocirce/zero_shot_audio_source_separation:4accc6885290aa9d1503a0d1d5c3a86e1917c076475357c87343eb6481be4bdf",
{
input: {
mix_file: "https://replicate.delivery/mgxm/37dba301-948f-493d-89d6-7adacb8160ad/SevenNationArmy_trimmed.mp3",
query_file: "https://replicate.delivery/mgxm/2362d82d-d016-445d-b9e2-b99f3e3f70ac/bass.wav"
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_7Am**********************************
This is your API token. Keep it to yourself.
import replicate
Run retrocirce/zero_shot_audio_source_separation using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"retrocirce/zero_shot_audio_source_separation:4accc6885290aa9d1503a0d1d5c3a86e1917c076475357c87343eb6481be4bdf",
input={
"mix_file": "https://replicate.delivery/mgxm/37dba301-948f-493d-89d6-7adacb8160ad/SevenNationArmy_trimmed.mp3",
"query_file": "https://replicate.delivery/mgxm/2362d82d-d016-445d-b9e2-b99f3e3f70ac/bass.wav"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_7Am**********************************
This is your API token. Keep it to yourself.
Run retrocirce/zero_shot_audio_source_separation using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "retrocirce/zero_shot_audio_source_separation:4accc6885290aa9d1503a0d1d5c3a86e1917c076475357c87343eb6481be4bdf",
"input": {
"mix_file": "https://replicate.delivery/mgxm/37dba301-948f-493d-89d6-7adacb8160ad/SevenNationArmy_trimmed.mp3",
"query_file": "https://replicate.delivery/mgxm/2362d82d-d016-445d-b9e2-b99f3e3f70ac/bass.wav"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "sueuqlbi7jdfrl22qc7zrnj3yi",
"model": "retrocirce/zero_shot_audio_source_separation",
"version": "4accc6885290aa9d1503a0d1d5c3a86e1917c076475357c87343eb6481be4bdf",
"input": {
"mix_file": "https://replicate.delivery/mgxm/37dba301-948f-493d-89d6-7adacb8160ad/SevenNationArmy_trimmed.mp3",
"query_file": "https://replicate.delivery/mgxm/2362d82d-d016-445d-b9e2-b99f3e3f70ac/bass.wav"
},
"logs": "/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/librosa/core/audio.py:162: UserWarning: PySoundFile failed. Trying audioread instead.\n warnings.warn(\"PySoundFile failed. Trying audioread instead.\")\nGPU available: True, used: True\nTPU available: False, using: 0 TPU cores\nIPU available: False, using: 0 IPUs\n/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py:679: LightningDeprecationWarning: `trainer.test(test_dataloaders)` is deprecated in v1.4 and will be removed in v1.6. Use `trainer.test(dataloaders)` instead.\n rank_zero_deprecation(\nLOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/pytorch_lightning/trainer/data_loading.py:105: UserWarning: The dataloader, test dataloader 0, does not have many workers which may be a bottleneck. Consider increasing the value of the `num_workers` argument` (try 8 which is the number of cpus on this machine) in the `DataLoader` init to improve performance.\n rank_zero_warn(\n\nTesting: 0it [00:00, ?it/s]\nTesting: 100%|██████████| 1/1 [00:01<00:00, 1.05s/it](1, 2048)\n(2048,)\n--------------------------------------------------------------------------------\nDATALOADER:0 TEST RESULTS\n{}\n--------------------------------------------------------------------------------\n\nTesting: 100%|██████████| 1/1 [00:01<00:00, 1.13s/it]\nLOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n\nTesting: 0it [00:00, ?it/s]\n\n0 {'query_name': 0.0}\n\nTesting: 0%| | 0/1 [00:01<?, ?it/s]\nTesting: 100%|██████████| 1/1 [00:01<00:00, 1.09s/it]\n\nmedian_sdr: {'query_name': 0.0}\n\nTesting: 100%|██████████| 1/1 [00:01<00:00, 1.09s/it]\n\nmax: {'query_name': 0.0}\n\nTesting: 100%|██████████| 1/1 [00:01<00:00, 1.09s/it]\n\nmin: {'query_name': 0.0}\n\nTesting: 100%|██████████| 1/1 [00:01<00:00, 1.09s/it]--------------------------------------------------------------------------------\nDATALOADER:0 TEST RESULTS\n{}\n--------------------------------------------------------------------------------\n\nTesting: 100%|██████████| 1/1 [00:01<00:00, 1.17s/it]",
"output": "https://replicate.delivery/mgxm/ee2c669c-8d27-43e4-8bfa-868124d13df0/0_query_name_pred_0.0.wav",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-04-26T14:19:39.92918Z",
"started_at": "2022-04-26T14:23:13.165026Z",
"completed_at": "2022-04-26T14:23:46.536112Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/sueuqlbi7jdfrl22qc7zrnj3yi/cancel",
"get": "https://api.replicate.com/v1/predictions/sueuqlbi7jdfrl22qc7zrnj3yi"
},
"metrics": {
"predict_time": 33.371086,
"total_time": 246.606932
}
}