typefile
{
"image": "https://replicate.delivery/mgxm/d80b0dac-f162-4c23-ae6c-9f5a72725900/demo.jpg",
"question": "what is in the picture?"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_SBQ**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run j-min/vl-t5 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"j-min/vl-t5:560b0f8439191dddf5babf188e34b63fb4e4d679fdb2c10d82988d25df798b7c",
{
input: {
image: "https://replicate.delivery/mgxm/d80b0dac-f162-4c23-ae6c-9f5a72725900/demo.jpg",
question: "what is in the picture?"
}
}
);
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_SBQ**********************************
This is your API token. Keep it to yourself.
import replicate
Run j-min/vl-t5 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"j-min/vl-t5:560b0f8439191dddf5babf188e34b63fb4e4d679fdb2c10d82988d25df798b7c",
input={
"image": "https://replicate.delivery/mgxm/d80b0dac-f162-4c23-ae6c-9f5a72725900/demo.jpg",
"question": "what is in the picture?"
}
)
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_SBQ**********************************
This is your API token. Keep it to yourself.
Run j-min/vl-t5 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": "j-min/vl-t5:560b0f8439191dddf5babf188e34b63fb4e4d679fdb2c10d82988d25df798b7c",
"input": {
"image": "https://replicate.delivery/mgxm/d80b0dac-f162-4c23-ae6c-9f5a72725900/demo.jpg",
"question": "what is in the picture?"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
dog
{
"id": "dyrpwgljczhabhnrwfviv633qi",
"model": "j-min/vl-t5",
"version": "560b0f8439191dddf5babf188e34b63fb4e4d679fdb2c10d82988d25df798b7c",
"input": {
"image": "https://replicate.delivery/mgxm/d80b0dac-f162-4c23-ae6c-9f5a72725900/demo.jpg",
"question": "what is in the picture?"
},
"logs": "/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/torch/functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:2157.)\n return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]",
"output": "dog",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-03-21T20:35:24.340005Z",
"started_at": "2022-03-21T20:37:13.250632Z",
"completed_at": "2022-03-21T20:37:18.852108Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/dyrpwgljczhabhnrwfviv633qi/cancel",
"get": "https://api.replicate.com/v1/predictions/dyrpwgljczhabhnrwfviv633qi"
},
"metrics": {
"predict_time": 5.601476,
"total_time": 114.512103
}
}