typefile
{
"beam_size": 3,
"ce_loss_scale": 0.25,
"cond_text": "Image of",
"end_factors": 1.06,
"image1": "https://replicate.delivery/mgxm/86dd6e37-464d-42dc-8a1b-ce977662dfc2/cow.jpg",
"image2": "https://replicate.delivery/mgxm/6c75d5d0-568f-44fc-8611-85f851a31b49/egg2.jpg",
"image3": "https://replicate.delivery/mgxm/11adcef9-aa5a-4372-848c-f41477c804b9/chicken.jpg",
"max_seq_lengths": "4"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_5aa**********************************
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: 3,
ce_loss_scale: 0.25,
cond_text: "Image of",
end_factors: 1.06,
image1: "https://replicate.delivery/mgxm/86dd6e37-464d-42dc-8a1b-ce977662dfc2/cow.jpg",
image2: "https://replicate.delivery/mgxm/6c75d5d0-568f-44fc-8611-85f851a31b49/egg2.jpg",
image3: "https://replicate.delivery/mgxm/11adcef9-aa5a-4372-848c-f41477c804b9/chicken.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_5aa**********************************
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": 3,
"ce_loss_scale": 0.25,
"cond_text": "Image of",
"end_factors": 1.06,
"image1": "https://replicate.delivery/mgxm/86dd6e37-464d-42dc-8a1b-ce977662dfc2/cow.jpg",
"image2": "https://replicate.delivery/mgxm/6c75d5d0-568f-44fc-8611-85f851a31b49/egg2.jpg",
"image3": "https://replicate.delivery/mgxm/11adcef9-aa5a-4372-848c-f41477c804b9/chicken.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_5aa**********************************
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": 3,
"ce_loss_scale": 0.25,
"cond_text": "Image of",
"end_factors": 1.06,
"image1": "https://replicate.delivery/mgxm/86dd6e37-464d-42dc-8a1b-ce977662dfc2/cow.jpg",
"image2": "https://replicate.delivery/mgxm/6c75d5d0-568f-44fc-8611-85f851a31b49/egg2.jpg",
"image3": "https://replicate.delivery/mgxm/11adcef9-aa5a-4372-848c-f41477c804b9/chicken.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 milk. \nBest fluency: Image of chicken fat. \nBest mixed: Image of milk.",
"typeMismatch": false
}
},
"inferred": false,
"outputValue": {
"text": "Best CLIP: Image of milk. \nBest fluency: Image of chicken fat. \nBest mixed: Image of milk."
},
"typeMismatch": false
}{
"id": "jhxohu544vfxhhyquxqyq67shy",
"model": "yoadtew/arithmetic",
"version": "737d4915f4d8303b5f38cd3ecbbc310bda34b76044473de002f1e23494d86218",
"input": {
"beam_size": 3,
"ce_loss_scale": 0.25,
"cond_text": "Image of",
"end_factors": 1.06,
"image1": "https://replicate.delivery/mgxm/86dd6e37-464d-42dc-8a1b-ce977662dfc2/cow.jpg",
"image2": "https://replicate.delivery/mgxm/6c75d5d0-568f-44fc-8611-85f851a31b49/egg2.jpg",
"image3": "https://replicate.delivery/mgxm/11adcef9-aa5a-4372-848c-f41477c804b9/chicken.jpg",
"max_seq_lengths": "4"
},
"logs": "07/02/2022 11:47:14 | [' milk %% -3.607249', ' the %% -4.146947', ' chicken %% -4.744006']\n07/02/2022 11:47:21 | [' milk. %% -2.757174', ' chicken fat %% -3.834673', ' chicken. %% -3.9611936']\n07/02/2022 11:47:28 | [' milk.! %% -2.757174', ' chicken fat. %% -3.1038754', ' chicken.! %% -3.9611936']",
"output": [
{
"text": "Best CLIP: Image of milk. \nBest fluency: Image of chicken fat. \nBest mixed: Image of milk."
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-02-07T11:47:10.888495Z",
"started_at": "2022-02-07T11:47:11.09605Z",
"completed_at": "2022-02-07T11:47:29.339765Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/jhxohu544vfxhhyquxqyq67shy/cancel",
"get": "https://api.replicate.com/v1/predictions/jhxohu544vfxhhyquxqyq67shy"
},
"metrics": {
"predict_time": 18.243715,
"total_time": 18.45127
}
}

