typefile
{
"absolute_second": false,
"audio_input": "https://replicate.delivery/pbxt/K5D74nOaaZcp7IBzh1IGWJBg2nyVg1leTQKEkYrQrn3WvB3q/ditto_chopped.wav",
"method": "WSOLA",
"s_fixed": 2,
"td_psola_pitch_shift": "None"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_9gD**********************************
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 sakemin/pytsmod using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"sakemin/pytsmod:111a5a32eb68a246da58451ff398444b2f692a2543cc132a02cfad4c45111cec",
{
input: {
absolute_second: false,
audio_input: "https://replicate.delivery/pbxt/K5D74nOaaZcp7IBzh1IGWJBg2nyVg1leTQKEkYrQrn3WvB3q/ditto_chopped.wav",
method: "WSOLA",
s_fixed: 2,
td_psola_pitch_shift: "None"
}
}
);
// 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_9gD**********************************
This is your API token. Keep it to yourself.
import replicate
Run sakemin/pytsmod using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"sakemin/pytsmod:111a5a32eb68a246da58451ff398444b2f692a2543cc132a02cfad4c45111cec",
input={
"absolute_second": False,
"audio_input": "https://replicate.delivery/pbxt/K5D74nOaaZcp7IBzh1IGWJBg2nyVg1leTQKEkYrQrn3WvB3q/ditto_chopped.wav",
"method": "WSOLA",
"s_fixed": 2,
"td_psola_pitch_shift": "None"
}
)
# 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_9gD**********************************
This is your API token. Keep it to yourself.
Run sakemin/pytsmod 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": "sakemin/pytsmod:111a5a32eb68a246da58451ff398444b2f692a2543cc132a02cfad4c45111cec",
"input": {
"absolute_second": false,
"audio_input": "https://replicate.delivery/pbxt/K5D74nOaaZcp7IBzh1IGWJBg2nyVg1leTQKEkYrQrn3WvB3q/ditto_chopped.wav",
"method": "WSOLA",
"s_fixed": 2,
"td_psola_pitch_shift": "None"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "m4vpvz3bhvsp4l7242oon5ezey",
"model": "sakemin/pytsmod",
"version": "111a5a32eb68a246da58451ff398444b2f692a2543cc132a02cfad4c45111cec",
"input": {
"absolute_second": false,
"audio_input": "https://replicate.delivery/pbxt/K5D74nOaaZcp7IBzh1IGWJBg2nyVg1leTQKEkYrQrn3WvB3q/ditto_chopped.wav",
"method": "WSOLA",
"s_fixed": 2,
"td_psola_pitch_shift": "None"
},
"logs": "",
"output": "https://replicate.delivery/pbxt/d49OOtRwQqrebC9l6AfBzUnu0vZsv1htBRpSCWcJKDfofeiQC/output.wav",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-12-21T05:14:54.398048Z",
"started_at": "2023-12-21T05:15:31.109861Z",
"completed_at": "2023-12-21T05:15:33.511415Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/m4vpvz3bhvsp4l7242oon5ezey/cancel",
"get": "https://api.replicate.com/v1/predictions/m4vpvz3bhvsp4l7242oon5ezey"
},
"metrics": {
"predict_time": 2.401554,
"total_time": 39.113367
}
}