Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
mtg /music-approachability-engagement:386cb3ec
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run mtg/music-approachability-engagement using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"mtg/music-approachability-engagement:386cb3ecc816d9486eb1d643a5ae02f74707c82dc1178613644ced06371b8f96",
{
input: {
url: "https://www.youtube.com/watch?v=7zp1TbLFPp8",
audio: "https://replicate.delivery/mgxm/3a90482a-2a14-435d-8c26-7cb5cb44b5d8/edm.mp3",
model_type: "effnet-discogs-test-3class"
}
}
);
// 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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run mtg/music-approachability-engagement using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"mtg/music-approachability-engagement:386cb3ecc816d9486eb1d643a5ae02f74707c82dc1178613644ced06371b8f96",
input={
"url": "https://www.youtube.com/watch?v=7zp1TbLFPp8",
"audio": "https://replicate.delivery/mgxm/3a90482a-2a14-435d-8c26-7cb5cb44b5d8/edm.mp3",
"model_type": "effnet-discogs-test-3class"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run mtg/music-approachability-engagement 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": "mtg/music-approachability-engagement:386cb3ecc816d9486eb1d643a5ae02f74707c82dc1178613644ced06371b8f96",
"input": {
"url": "https://www.youtube.com/watch?v=7zp1TbLFPp8",
"audio": "https://replicate.delivery/mgxm/3a90482a-2a14-435d-8c26-7cb5cb44b5d8/edm.mp3",
"model_type": "effnet-discogs-test-3class"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Rendering markdown...
{
"completed_at": "2023-05-25T09:53:38.577233Z",
"created_at": "2023-05-25T09:53:26.782312Z",
"data_removed": false,
"error": null,
"id": "xuwomftygrhdppkrydkex7uxem",
"input": {
"url": "https://www.youtube.com/watch?v=7zp1TbLFPp8",
"audio": "https://replicate.delivery/mgxm/3a90482a-2a14-435d-8c26-7cb5cb44b5d8/edm.mp3",
"model_type": "effnet-discogs-test-3class"
},
"logs": "Warning: Both `url` and `audio` inputs were specified. The `url` will be process. To process the `audio` input clear the `url` input field.\n[youtube] 7zp1TbLFPp8: Downloading webpage\n[youtube] 7zp1TbLFPp8: Downloading player 41b8bed0\n[dashsegments] Total fragments: 1\n[download] Destination: /tmp/tmpcrpzmo5l/audio.webm\n[download] 0.0% of ~3.69MiB at 12.07KiB/s ETA 05:13\n[download] 0.1% of ~3.69MiB at 36.14KiB/s ETA 01:44\n[download] 0.2% of ~3.69MiB at 84.15KiB/s ETA 00:44\n[download] 0.4% of ~3.69MiB at 179.39KiB/s ETA 00:20\n[download] 0.8% of ~3.69MiB at 365.14KiB/s ETA 00:10\n[download] 1.7% of ~3.69MiB at 628.36KiB/s ETA 00:05\n[download] 3.4% of ~3.69MiB at 1.10MiB/s ETA 00:03\n[download] 6.7% of ~3.69MiB at 1.88MiB/s ETA 00:01\n[download] 13.5% of ~3.69MiB at 3.60MiB/s ETA 00:00\n[download] 27.0% of ~3.69MiB at 5.76MiB/s ETA 00:00\n[download] 54.1% of ~3.69MiB at 9.47MiB/s ETA 00:00\n[download] 100.0% of ~3.69MiB at 16.50MiB/s ETA 00:00\n[download] 100.0% of ~3.69MiB at 16.45MiB/s ETA 00:00\n[download] 100% of 3.69MiB in 00:00\n[ffmpeg] Destination: /tmp/tmpcrpzmo5l/audio.wav\nDeleting original file /tmp/tmpcrpzmo5l/audio.webm (pass -k to keep)\nloading audio...\nrunning classification heads...\n2023-05-25 09:53:35.885714: I tensorflow/core/platform/profile_utils/cpu_utils.cc:114] CPU Frequency: 2299995000 Hz\n[ INFO ] TensorflowPredict: Successfully loaded graph file: `/models/approachability-3class.pb`\n[ INFO ] TensorflowPredict: Successfully loaded graph file: `/models/engagement-3class.pb`\ndone!",
"metrics": {
"predict_time": 11.739723,
"total_time": 11.794921
},
"output": "https://replicate.delivery/pbxt/9QHmo1buBp5TOhJVliul8HWMnaZgacRChRVyeD3IK5JREnfQA/out.md",
"started_at": "2023-05-25T09:53:26.837510Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/xuwomftygrhdppkrydkex7uxem",
"cancel": "https://api.replicate.com/v1/predictions/xuwomftygrhdppkrydkex7uxem/cancel"
},
"version": "386cb3ecc816d9486eb1d643a5ae02f74707c82dc1178613644ced06371b8f96"
}
Warning: Both `url` and `audio` inputs were specified. The `url` will be process. To process the `audio` input clear the `url` input field.
[youtube] 7zp1TbLFPp8: Downloading webpage
[youtube] 7zp1TbLFPp8: Downloading player 41b8bed0
[dashsegments] Total fragments: 1
[download] Destination: /tmp/tmpcrpzmo5l/audio.webm
[download] 0.0% of ~3.69MiB at 12.07KiB/s ETA 05:13
[download] 0.1% of ~3.69MiB at 36.14KiB/s ETA 01:44
[download] 0.2% of ~3.69MiB at 84.15KiB/s ETA 00:44
[download] 0.4% of ~3.69MiB at 179.39KiB/s ETA 00:20
[download] 0.8% of ~3.69MiB at 365.14KiB/s ETA 00:10
[download] 1.7% of ~3.69MiB at 628.36KiB/s ETA 00:05
[download] 3.4% of ~3.69MiB at 1.10MiB/s ETA 00:03
[download] 6.7% of ~3.69MiB at 1.88MiB/s ETA 00:01
[download] 13.5% of ~3.69MiB at 3.60MiB/s ETA 00:00
[download] 27.0% of ~3.69MiB at 5.76MiB/s ETA 00:00
[download] 54.1% of ~3.69MiB at 9.47MiB/s ETA 00:00
[download] 100.0% of ~3.69MiB at 16.50MiB/s ETA 00:00
[download] 100.0% of ~3.69MiB at 16.45MiB/s ETA 00:00
[download] 100% of 3.69MiB in 00:00
[ffmpeg] Destination: /tmp/tmpcrpzmo5l/audio.wav
Deleting original file /tmp/tmpcrpzmo5l/audio.webm (pass -k to keep)
loading audio...
running classification heads...
2023-05-25 09:53:35.885714: I tensorflow/core/platform/profile_utils/cpu_utils.cc:114] CPU Frequency: 2299995000 Hz
[ INFO ] TensorflowPredict: Successfully loaded graph file: `/models/approachability-3class.pb`
[ INFO ] TensorflowPredict: Successfully loaded graph file: `/models/engagement-3class.pb`
done!