typefile
{
"input_image": "https://replicate.delivery/pbxt/Lg6495P56J6wq1WFLML3jPlCuXLOQii8eoPNb1iFwsFiJXVw/book3.jpeg",
"max_new_tokens": 2048,
"prompt": "Describe this image.",
"temperature": 0.7,
"top_p": 0.9
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_ZLb**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run chenxwh/cogvlm2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"chenxwh/cogvlm2:6d0394ab8fd98efb399c29c03c84c29f1d43c0259c6ee63d12f44def476c92b2",
{
input: {
input_image: "https://replicate.delivery/pbxt/Lg6495P56J6wq1WFLML3jPlCuXLOQii8eoPNb1iFwsFiJXVw/book3.jpeg",
max_new_tokens: 2048,
prompt: "Describe this image.",
temperature: 0.7,
top_p: 0.9
}
}
);
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_ZLb**********************************
This is your API token. Keep it to yourself.
import replicate
Run chenxwh/cogvlm2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"chenxwh/cogvlm2:6d0394ab8fd98efb399c29c03c84c29f1d43c0259c6ee63d12f44def476c92b2",
input={
"input_image": "https://replicate.delivery/pbxt/Lg6495P56J6wq1WFLML3jPlCuXLOQii8eoPNb1iFwsFiJXVw/book3.jpeg",
"max_new_tokens": 2048,
"prompt": "Describe this image.",
"temperature": 0.7,
"top_p": 0.9
}
)
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_ZLb**********************************
This is your API token. Keep it to yourself.
Run chenxwh/cogvlm2 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": "chenxwh/cogvlm2:6d0394ab8fd98efb399c29c03c84c29f1d43c0259c6ee63d12f44def476c92b2",
"input": {
"input_image": "https://replicate.delivery/pbxt/Lg6495P56J6wq1WFLML3jPlCuXLOQii8eoPNb1iFwsFiJXVw/book3.jpeg",
"max_new_tokens": 2048,
"prompt": "Describe this image.",
"temperature": 0.7,
"top_p": 0.9
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
The image captures a well-lit, modern library or bookstore with a distinct industrial aesthetic. The main focus is a large, wooden bookshelf filled with an assortment of books, creating a warm and inviting atmosphere. The bookshelf is positioned against a rustic brick wall, which adds a touch of vintage charm to the space. The room is illuminated by hanging light bulbs, which dangle from the ceiling in a casual manner. There are also decorative elements such as a potted plant, a small framed sign, and a table with various items on it, enhancing the cozy ambiance. A person is seated at a desk in the foreground, suggesting the space is functional for reading or studying.
{
"id": "r8pb3fq20drgj0cj4p6rfznsac",
"model": "chenxwh/cogvlm2",
"version": "6d0394ab8fd98efb399c29c03c84c29f1d43c0259c6ee63d12f44def476c92b2",
"input": {
"input_image": "https://replicate.delivery/pbxt/Lg6495P56J6wq1WFLML3jPlCuXLOQii8eoPNb1iFwsFiJXVw/book3.jpeg",
"max_new_tokens": 2048,
"prompt": "Describe this image.",
"temperature": 0.7,
"top_p": 0.9
},
"logs": "/root/.pyenv/versions/3.11.10/lib/python3.11/site-packages/bitsandbytes/autograd/_functions.py:316: UserWarning: MatMul8bitLt: inputs will be cast from torch.bfloat16 to float16 during quantization\nwarnings.warn(f\"MatMul8bitLt: inputs will be cast from {A.dtype} to float16 during quantization\")\n/root/.pyenv/versions/3.11.10/lib/python3.11/site-packages/bitsandbytes/autograd/_functions.py:316: UserWarning: MatMul8bitLt: inputs will be cast from torch.bfloat16 to float16 during quantization\nwarnings.warn(f\"MatMul8bitLt: inputs will be cast from {A.dtype} to float16 during quantization\")\n/root/.pyenv/versions/3.11.10/lib/python3.11/site-packages/bitsandbytes/autograd/_functions.py:316: UserWarning: MatMul8bitLt: inputs will be cast from torch.bfloat16 to float16 during quantization\nwarnings.warn(f\"MatMul8bitLt: inputs will be cast from {A.dtype} to float16 during quantization\")",
"output": "The image captures a well-lit, modern library or bookstore with a distinct industrial aesthetic. The main focus is a large, wooden bookshelf filled with an assortment of books, creating a warm and inviting atmosphere. The bookshelf is positioned against a rustic brick wall, which adds a touch of vintage charm to the space. The room is illuminated by hanging light bulbs, which dangle from the ceiling in a casual manner. There are also decorative elements such as a potted plant, a small framed sign, and a table with various items on it, enhancing the cozy ambiance. A person is seated at a desk in the foreground, suggesting the space is functional for reading or studying.",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-09-24T19:41:48.419Z",
"started_at": "2024-09-24T19:44:54.262623Z",
"completed_at": "2024-09-24T19:45:18.433249Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/r8pb3fq20drgj0cj4p6rfznsac/cancel",
"get": "https://api.replicate.com/v1/predictions/r8pb3fq20drgj0cj4p6rfznsac",
"web": "https://replicate.com/p/r8pb3fq20drgj0cj4p6rfznsac"
},
"metrics": {
"predict_time": 24.170625701,
"total_time": 210.014249
}
}