typefile
{
"history": [],
"image": "https://replicate.delivery/pbxt/LFOt8fqTcx6MfmTNNXES25GXjnpT1Iqv87IOuOCb7Eq0ZRvM/Screenshot%202024-07-11%20at%209.03.27%20AM.png",
"max_tokens": 1024,
"prompt": "Reply in json format with the following keys - containsCircles : True or False, colorsOfCircles: array of str, numberOfCircles: int, containsText: Boolean, text: str, characterInsideCircle: str",
"temperature": 0.2,
"top_p": 1
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_XbS**********************************
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-v1.6-mistral-7b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"yorickvp/llava-v1.6-mistral-7b:19be067b589d0c46689ffa7cc3ff321447a441986a7694c01225973c2eafc874",
{
input: {
image: "https://replicate.delivery/pbxt/LFOt8fqTcx6MfmTNNXES25GXjnpT1Iqv87IOuOCb7Eq0ZRvM/Screenshot%202024-07-11%20at%209.03.27%20AM.png",
max_tokens: 1024,
prompt: "Reply in json format with the following keys - containsCircles : True or False, colorsOfCircles: array of str, numberOfCircles: int, containsText: Boolean, text: str, characterInsideCircle: str",
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_XbS**********************************
This is your API token. Keep it to yourself.
import replicate
Run yorickvp/llava-v1.6-mistral-7b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"yorickvp/llava-v1.6-mistral-7b:19be067b589d0c46689ffa7cc3ff321447a441986a7694c01225973c2eafc874",
input={
"image": "https://replicate.delivery/pbxt/LFOt8fqTcx6MfmTNNXES25GXjnpT1Iqv87IOuOCb7Eq0ZRvM/Screenshot%202024-07-11%20at%209.03.27%20AM.png",
"max_tokens": 1024,
"prompt": "Reply in json format with the following keys - containsCircles : True or False, colorsOfCircles: array of str, numberOfCircles: int, containsText: Boolean, text: str, characterInsideCircle: str",
"temperature": 0.2,
"top_p": 1
}
)
# The yorickvp/llava-v1.6-mistral-7b 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-v1.6-mistral-7b/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_XbS**********************************
This is your API token. Keep it to yourself.
Run yorickvp/llava-v1.6-mistral-7b 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-v1.6-mistral-7b:19be067b589d0c46689ffa7cc3ff321447a441986a7694c01225973c2eafc874",
"input": {
"image": "https://replicate.delivery/pbxt/LFOt8fqTcx6MfmTNNXES25GXjnpT1Iqv87IOuOCb7Eq0ZRvM/Screenshot%202024-07-11%20at%209.03.27%20AM.png",
"max_tokens": 1024,
"prompt": "Reply in json format with the following keys - containsCircles : True or False, colorsOfCircles: array of str, numberOfCircles: int, containsText: Boolean, text: str, characterInsideCircle: str",
"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.
```json
{
"containsCircles": true,
"colorsOfCircles": ["red"],
"numberOfCircles": 1,
"containsText": true,
"text": "Acknowledgement",
"characterInsideCircle": "A"
}
``` {
"id": "1ycah63hr1rgg0cgkzf99srpxm",
"model": "yorickvp/llava-v1.6-mistral-7b",
"version": "19be067b589d0c46689ffa7cc3ff321447a441986a7694c01225973c2eafc874",
"input": {
"history": [],
"image": "https://replicate.delivery/pbxt/LFOt8fqTcx6MfmTNNXES25GXjnpT1Iqv87IOuOCb7Eq0ZRvM/Screenshot%202024-07-11%20at%209.03.27%20AM.png",
"max_tokens": 1024,
"prompt": "Reply in json format with the following keys - containsCircles : True or False, colorsOfCircles: array of str, numberOfCircles: int, containsText: Boolean, text: str, characterInsideCircle: str",
"temperature": 0.2,
"top_p": 1
},
"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`:2 for open-end generation.",
"output": [
"```json\n",
"{\n",
" ",
"\"containsCircles\": ",
"true,\n",
" ",
"\"colorsOfCircles\": ",
"[\"red\"],\n",
" ",
"\"numberOfCircles\": ",
"1,\n",
" ",
"\"containsText\": ",
"true,\n",
" ",
"\"text\": ",
"\"Acknowledgement\",\n",
" ",
"\"characterInsideCircle\": ",
"\"A\"\n",
"}\n",
"``` "
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-07-11T03:37:53.856Z",
"started_at": "2024-07-11T03:37:53.898445Z",
"completed_at": "2024-07-11T03:37:57.127073Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/1ycah63hr1rgg0cgkzf99srpxm/cancel",
"get": "https://api.replicate.com/v1/predictions/1ycah63hr1rgg0cgkzf99srpxm",
"stream": "https://streaming-api.svc.us.c.replicate.net/v1/streams/layv43k6rtu2udoeffe7zacijprs665hnkvh7in3se3lgsooipaq",
"web": "https://replicate.com/p/1ycah63hr1rgg0cgkzf99srpxm"
},
"metrics": {
"predict_time": 3.228627719,
"total_time": 3.271073
}
}