typetext
{
"image": "https://replicate.delivery/pbxt/JjK2zhdhMpdevuSR7POm4X64qa2fVWv8miI4NBlkoHWVPmpD/chart.png",
"max_new_tokens": 512,
"prompt": "What is the highest life expectancy at birth of male?"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_PSa**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run lucataco/fuyu-8b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lucataco/fuyu-8b:42f23bc876570a46f5a90737086fbc4c3f79dd11753a28eaa39544dd391815e9",
{
input: {
image: "https://replicate.delivery/pbxt/JjK2zhdhMpdevuSR7POm4X64qa2fVWv8miI4NBlkoHWVPmpD/chart.png",
max_new_tokens: 512,
prompt: "What is the highest life expectancy at birth of male?"
}
}
);
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_PSa**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/fuyu-8b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/fuyu-8b:42f23bc876570a46f5a90737086fbc4c3f79dd11753a28eaa39544dd391815e9",
input={
"image": "https://replicate.delivery/pbxt/JjK2zhdhMpdevuSR7POm4X64qa2fVWv8miI4NBlkoHWVPmpD/chart.png",
"max_new_tokens": 512,
"prompt": "What is the highest life expectancy at birth of male?"
}
)
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=r8_PSa**********************************
This is your API token. Keep it to yourself.
Run lucataco/fuyu-8b 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": "lucataco/fuyu-8b:42f23bc876570a46f5a90737086fbc4c3f79dd11753a28eaa39544dd391815e9",
"input": {
"image": "https://replicate.delivery/pbxt/JjK2zhdhMpdevuSR7POm4X64qa2fVWv8miI4NBlkoHWVPmpD/chart.png",
"max_new_tokens": 512,
"prompt": "What is the highest life expectancy at birth of male?"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
The life expectancy at birth of males in 2018 is 80.7.
{
"id": "3nbj7itblurqdjpmbn3rhe5gde",
"model": "lucataco/fuyu-8b",
"version": "42f23bc876570a46f5a90737086fbc4c3f79dd11753a28eaa39544dd391815e9",
"input": {
"image": "https://replicate.delivery/pbxt/JjK2zhdhMpdevuSR7POm4X64qa2fVWv8miI4NBlkoHWVPmpD/chart.png",
"max_new_tokens": 512,
"prompt": "What is the highest life expectancy at birth of male?"
},
"logs": "The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.\nSetting `pad_token_id` to `eos_token_id`:71013 for open-end generation.",
"output": "\u0004 The life expectancy at birth of males in 2018 is 80.7.",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-10-20T02:37:00.475259Z",
"started_at": "2023-10-20T02:37:00.451403Z",
"completed_at": "2023-10-20T02:37:02.309961Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/3nbj7itblurqdjpmbn3rhe5gde/cancel",
"get": "https://api.replicate.com/v1/predictions/3nbj7itblurqdjpmbn3rhe5gde"
},
"metrics": {
"predict_time": 1.858558,
"total_time": 1.834702
}
}