typefile
{
"beam_size": "5",
"ce_loss_scale": 0.2,
"cond_text": "Image of",
"end_factors": 1.06,
"image1": "https://replicate.delivery/mgxm/2fa6c68f-a992-429a-80a8-29dc735c481e/kremlin.jpg",
"image2": "https://replicate.delivery/mgxm/9eec82ca-4be4-4676-98ac-7aae2bfdada9/usa.jpg",
"image3": "https://replicate.delivery/mgxm/10251a76-31ac-4c6e-a946-0dbb4e67ef3b/capitol.jpg",
"max_seq_lengths": "4"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_XiQ**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run yoadtew/arithmetic using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"yoadtew/arithmetic:737d4915f4d8303b5f38cd3ecbbc310bda34b76044473de002f1e23494d86218",
{
input: {
beam_size: "5",
ce_loss_scale: 0.2,
cond_text: "Image of",
end_factors: 1.06,
image1: "https://replicate.delivery/mgxm/2fa6c68f-a992-429a-80a8-29dc735c481e/kremlin.jpg",
image2: "https://replicate.delivery/mgxm/9eec82ca-4be4-4676-98ac-7aae2bfdada9/usa.jpg",
image3: "https://replicate.delivery/mgxm/10251a76-31ac-4c6e-a946-0dbb4e67ef3b/capitol.jpg",
max_seq_lengths: "4"
}
}
);
console.log(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_XiQ**********************************
This is your API token. Keep it to yourself.
import replicate
Run yoadtew/arithmetic using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"yoadtew/arithmetic:737d4915f4d8303b5f38cd3ecbbc310bda34b76044473de002f1e23494d86218",
input={
"beam_size": "5",
"ce_loss_scale": 0.2,
"cond_text": "Image of",
"end_factors": 1.06,
"image1": "https://replicate.delivery/mgxm/2fa6c68f-a992-429a-80a8-29dc735c481e/kremlin.jpg",
"image2": "https://replicate.delivery/mgxm/9eec82ca-4be4-4676-98ac-7aae2bfdada9/usa.jpg",
"image3": "https://replicate.delivery/mgxm/10251a76-31ac-4c6e-a946-0dbb4e67ef3b/capitol.jpg",
"max_seq_lengths": "4"
}
)
# The yoadtew/arithmetic model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/yoadtew/arithmetic/api#output-schema
print(item)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_XiQ**********************************
This is your API token. Keep it to yourself.
Run yoadtew/arithmetic 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": "yoadtew/arithmetic:737d4915f4d8303b5f38cd3ecbbc310bda34b76044473de002f1e23494d86218",
"input": {
"beam_size": "5",
"ce_loss_scale": 0.2,
"cond_text": "Image of",
"end_factors": 1.06,
"image1": "https://replicate.delivery/mgxm/2fa6c68f-a992-429a-80a8-29dc735c481e/kremlin.jpg",
"image2": "https://replicate.delivery/mgxm/9eec82ca-4be4-4676-98ac-7aae2bfdada9/usa.jpg",
"image3": "https://replicate.delivery/mgxm/10251a76-31ac-4c6e-a946-0dbb4e67ef3b/capitol.jpg",
"max_seq_lengths": "4"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"outputType": "object",
"properties": {
"text": {
"outputType": "text",
"inferred": false,
"outputValue": "Best CLIP: Image of Russia Russia is a \nBest fluency: Image of Russia Russia is the \nBest mixed: Image of Russia Russia.",
"typeMismatch": false
}
},
"inferred": false,
"outputValue": {
"text": "Best CLIP: Image of Russia Russia is a \nBest fluency: Image of Russia Russia is the \nBest mixed: Image of Russia Russia."
},
"typeMismatch": false
}{
"id": "n6cpgvuwyzgcrnpii6523fhqum",
"model": "yoadtew/arithmetic",
"version": "737d4915f4d8303b5f38cd3ecbbc310bda34b76044473de002f1e23494d86218",
"input": {
"beam_size": "5",
"ce_loss_scale": 0.2,
"cond_text": "Image of",
"end_factors": 1.06,
"image1": "https://replicate.delivery/mgxm/2fa6c68f-a992-429a-80a8-29dc735c481e/kremlin.jpg",
"image2": "https://replicate.delivery/mgxm/9eec82ca-4be4-4676-98ac-7aae2bfdada9/usa.jpg",
"image3": "https://replicate.delivery/mgxm/10251a76-31ac-4c6e-a946-0dbb4e67ef3b/capitol.jpg",
"max_seq_lengths": "4"
},
"logs": "07/02/2022 20:41:38 | [' Russia %% -2.124317', ' Russian %% -2.4558306', ' the %% -3.5170617', ' Russians %% -4.037196', ' US %% -4.1297226']\n07/02/2022 20:41:50 | [' Russia Russia %% -2.1668415', ' Russian. %% -2.404074', ' the Russian %% -3.0759494', ' Russians. %% -3.7069006', ' Russia Russian %% -3.7998052']\n07/02/2022 20:42:02 | [' Russia Russia. %% -2.2597458', ' Russian.! %% -2.404074', \" Russia Russia's %% -3.2141354\", ' Russia Russia has %% -3.3322175', ' Russia Russia is %% -3.3513412']\n07/02/2022 20:42:13 | [' Russia Russia.! %% -2.2597458', ' Russian.!! %% -2.404074', ' Russia Russia is the %% -3.6605666', ' Russia Russia is a %% -3.7493534', ' Russia Russia is. %% -3.7535248']",
"output": [
{
"text": "Best CLIP: Image of Russia Russia is a \nBest fluency: Image of Russia Russia is the \nBest mixed: Image of Russia Russia."
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-02-07T20:41:35.48047Z",
"started_at": "2022-02-07T20:41:35.668268Z",
"completed_at": "2022-02-07T20:42:14.498934Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/n6cpgvuwyzgcrnpii6523fhqum/cancel",
"get": "https://api.replicate.com/v1/predictions/n6cpgvuwyzgcrnpii6523fhqum"
},
"metrics": {
"predict_time": 38.830666,
"total_time": 39.018464
}
}

