typefile
{
"beam_size": "5",
"ce_loss_scale": 0.2,
"cond_text": "Image of",
"end_factors": 1.06,
"image1": "https://replicate.delivery/mgxm/ae9ba19a-3ef0-4724-b6c5-715a0be39692/eiffle.jpg",
"image2": "https://replicate.delivery/mgxm/9e0c882e-3c1a-40b6-b231-d032a10b5ebd/usa.jpg",
"image3": "https://replicate.delivery/mgxm/2c259b12-8940-4502-8206-9af24e663ee2/capitol.jpg",
"max_seq_lengths": "4"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_RQd**********************************
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/ae9ba19a-3ef0-4724-b6c5-715a0be39692/eiffle.jpg",
image2: "https://replicate.delivery/mgxm/9e0c882e-3c1a-40b6-b231-d032a10b5ebd/usa.jpg",
image3: "https://replicate.delivery/mgxm/2c259b12-8940-4502-8206-9af24e663ee2/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_RQd**********************************
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/ae9ba19a-3ef0-4724-b6c5-715a0be39692/eiffle.jpg",
"image2": "https://replicate.delivery/mgxm/9e0c882e-3c1a-40b6-b231-d032a10b5ebd/usa.jpg",
"image3": "https://replicate.delivery/mgxm/2c259b12-8940-4502-8206-9af24e663ee2/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_RQd**********************************
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/ae9ba19a-3ef0-4724-b6c5-715a0be39692/eiffle.jpg",
"image2": "https://replicate.delivery/mgxm/9e0c882e-3c1a-40b6-b231-d032a10b5ebd/usa.jpg",
"image3": "https://replicate.delivery/mgxm/2c259b12-8940-4502-8206-9af24e663ee2/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 France. \nBest fluency: Image of the world. \nBest mixed: Image of France.",
"typeMismatch": false
}
},
"inferred": false,
"outputValue": {
"text": "Best CLIP: Image of France. \nBest fluency: Image of the world. \nBest mixed: Image of France."
},
"typeMismatch": false
}{
"id": "j5g4qing2jaindriw26klxql4y",
"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/ae9ba19a-3ef0-4724-b6c5-715a0be39692/eiffle.jpg",
"image2": "https://replicate.delivery/mgxm/9e0c882e-3c1a-40b6-b231-d032a10b5ebd/usa.jpg",
"image3": "https://replicate.delivery/mgxm/2c259b12-8940-4502-8206-9af24e663ee2/capitol.jpg",
"max_seq_lengths": "4"
},
"logs": "07/02/2022 20:40:53 | [' French %% -1.5718586', ' the %% -1.7321693', ' France %% -2.646708', ' World %% -3.665781', ' world %% -4.00222']\n07/02/2022 20:41:05 | [' France. %% -2.2273226', ' French. %% -2.5530052', ' the world %% -2.7489004', ' world. %% -2.9033055', ' the French %% -2.97674']\n07/02/2022 20:41:16 | [' France.! %% -2.2273226', ' the world. %% -2.4138563', ' French.! %% -2.5530052', ' world.! %% -2.9033055', ' the French. %% -2.954996']",
"output": [
{
"text": "Best CLIP: Image of France. \nBest fluency: Image of the world. \nBest mixed: Image of France."
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-02-07T20:40:50.511373Z",
"started_at": "2022-02-07T20:40:50.717627Z",
"completed_at": "2022-02-07T20:41:17.46832Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/j5g4qing2jaindriw26klxql4y/cancel",
"get": "https://api.replicate.com/v1/predictions/j5g4qing2jaindriw26klxql4y"
},
"metrics": {
"predict_time": 26.750693,
"total_time": 26.956947
}
}

