typefile
{
"image": "https://replicate.delivery/pbxt/JyTSl0rWVIVzyx4tkc3rF5Mo7vADbdKrvwhvgVDaqTSudxuR/Selfie%202023-12-01%20at%2011.05.11.png",
"max_tokens": 1024,
"prompt": "what is this person doing?",
"temperature": 0.2,
"top_p": 1
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_1KU**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run yorickvp/llava-13b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"yorickvp/llava-13b:e272157381e2a3bf12df3a8edd1f38d1dbd736bbb7437277c8b34175f8fce358",
{
input: {
image: "https://replicate.delivery/pbxt/JyTSl0rWVIVzyx4tkc3rF5Mo7vADbdKrvwhvgVDaqTSudxuR/Selfie%202023-12-01%20at%2011.05.11.png",
max_tokens: 1024,
prompt: "what is this person doing?",
temperature: 0.2,
top_p: 1
}
}
);
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_1KU**********************************
This is your API token. Keep it to yourself.
import replicate
Run yorickvp/llava-13b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"yorickvp/llava-13b:e272157381e2a3bf12df3a8edd1f38d1dbd736bbb7437277c8b34175f8fce358",
input={
"image": "https://replicate.delivery/pbxt/JyTSl0rWVIVzyx4tkc3rF5Mo7vADbdKrvwhvgVDaqTSudxuR/Selfie%202023-12-01%20at%2011.05.11.png",
"max_tokens": 1024,
"prompt": "what is this person doing?",
"temperature": 0.2,
"top_p": 1
}
)
# The yorickvp/llava-13b 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/yorickvp/llava-13b/api#output-schema
print(item, end="")
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_1KU**********************************
This is your API token. Keep it to yourself.
Run yorickvp/llava-13b 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": "yorickvp/llava-13b:e272157381e2a3bf12df3a8edd1f38d1dbd736bbb7437277c8b34175f8fce358",
"input": {
"image": "https://replicate.delivery/pbxt/JyTSl0rWVIVzyx4tkc3rF5Mo7vADbdKrvwhvgVDaqTSudxuR/Selfie%202023-12-01%20at%2011.05.11.png",
"max_tokens": 1024,
"prompt": "what is this person doing?",
"temperature": 0.2,
"top_p": 1
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
The person in the image is holding a red cup up to their mouth, opening their mouth wide, and pretending to take a bite or drink from the cup.
{
"id": "32jbpm3btrsuyflapco2xf2eza",
"model": "yorickvp/llava-13b",
"version": "e272157381e2a3bf12df3a8edd1f38d1dbd736bbb7437277c8b34175f8fce358",
"input": {
"image": "https://replicate.delivery/pbxt/JyTSl0rWVIVzyx4tkc3rF5Mo7vADbdKrvwhvgVDaqTSudxuR/Selfie%202023-12-01%20at%2011.05.11.png",
"max_tokens": 1024,
"prompt": "what is this person doing?",
"temperature": 0.2,
"top_p": 1
},
"logs": "",
"output": [
"The ",
"person ",
"in ",
"the ",
"image ",
"is ",
"holding ",
"a ",
"red ",
"cup ",
"up ",
"to ",
"their ",
"mouth, ",
"opening ",
"their ",
"mouth ",
"wide, ",
"and ",
"pretending ",
"to ",
"take ",
"a ",
"bite ",
"or ",
"drink ",
"from ",
"the ",
"cup."
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-12-01T19:05:40.473875Z",
"started_at": "2023-12-01T19:05:40.479209Z",
"completed_at": "2023-12-01T19:05:43.021243Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/32jbpm3btrsuyflapco2xf2eza/cancel",
"get": "https://api.replicate.com/v1/predictions/32jbpm3btrsuyflapco2xf2eza",
"stream": "https://streaming-api.svc.us.c.replicate.net/v1/predictions/32jbpm3btrsuyflapco2xf2eza"
},
"metrics": {
"predict_time": 2.542034,
"total_time": 2.547368
}
}