Prediction
yorickvp/llava-13b:e272157381e2a3bf12df3a8edd1f38d1dbd736bbb7437277c8b34175f8fce358ID
32jbpm3btrsuyflapco2xf2eza
Status
Succeeded
Source
Web
Hardware
A40 (Large)
Total duration
Created
by @cbh123
Input
{
"image": "https://replicate.delivery/pbxt/JyTSl0rWVIVzyx4tkc3rF5Mo7vADbdKrvwhvgVDaqTSudxuR/Selfie%202023-12-01%20at%2011.05.11.png",
"top_p": 1,
"prompt": "what is this person doing?",
"max_tokens": 1024,
"temperature": 0.2
}
Install Replicate’s Node.js client library:
npm install replicate
Set the
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:
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",
top_p: 1,
prompt: "what is this person doing?",
max_tokens: 1024,
temperature: 0.2
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:
pip install replicate
Set the
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:
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",
"top_p": 1,
"prompt": "what is this person doing?",
"max_tokens": 1024,
"temperature": 0.2
}
)
# 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.
Set the
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
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",
"top_p": 1,
"prompt": "what is this person doing?",
"max_tokens": 1024,
"temperature": 0.2
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
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.
{
"completed_at": "2023-12-01T19:05:43.021243Z",
"created_at": "2023-12-01T19:05:40.473875Z",
"data_removed": false,
"error": null,
"id": "32jbpm3btrsuyflapco2xf2eza",
"input": {
"image": "https://replicate.delivery/pbxt/JyTSl0rWVIVzyx4tkc3rF5Mo7vADbdKrvwhvgVDaqTSudxuR/Selfie%202023-12-01%20at%2011.05.11.png",
"top_p": 1,
"prompt": "what is this person doing?",
"max_tokens": 1024,
"temperature": 0.2
},
"logs": null,
"metrics": {
"predict_time": 2.542034,
"total_time": 2.547368
},
"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."
],
"started_at": "2023-12-01T19:05:40.479209Z",
"status": "succeeded",
"urls": {
"stream": "https://streaming-api.svc.us.c.replicate.net/v1/predictions/32jbpm3btrsuyflapco2xf2eza",
"get": "https://api.replicate.com/v1/predictions/32jbpm3btrsuyflapco2xf2eza",
"cancel": "https://api.replicate.com/v1/predictions/32jbpm3btrsuyflapco2xf2eza/cancel"
},
"version": "e272157381e2a3bf12df3a8edd1f38d1dbd736bbb7437277c8b34175f8fce358"
}
Generated in