typetext
{
"debug": false,
"max_new_tokens": 128,
"min_new_tokens": -1,
"prompt": "Here is a description of an image. Can you pretend you are David Attenborough and narrate it as if it is a nature documentary. Make it short. If I do anything remotely interesting, make a big deal about it!\n\nDESCRIPTION:\nThe 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.",
"temperature": 0.7,
"top_k": 50,
"top_p": 0.9
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_3iN**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run mistralai/mistral-7b-instruct-v0.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"mistralai/mistral-7b-instruct-v0.1:83b6a56e7c828e667f21fd596c338fd4f0039b46bcfa18d973e8e70e455fda70",
{
input: {
debug: false,
max_new_tokens: 128,
min_new_tokens: -1,
prompt: "Here is a description of an image. Can you pretend you are David Attenborough and narrate it as if it is a nature documentary. Make it short. If I do anything remotely interesting, make a big deal about it!\n\nDESCRIPTION:\nThe 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.",
temperature: 0.7,
top_k: 50,
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_3iN**********************************
This is your API token. Keep it to yourself.
import replicate
Run mistralai/mistral-7b-instruct-v0.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"mistralai/mistral-7b-instruct-v0.1:83b6a56e7c828e667f21fd596c338fd4f0039b46bcfa18d973e8e70e455fda70",
input={
"debug": False,
"max_new_tokens": 128,
"min_new_tokens": -1,
"prompt": "Here is a description of an image. Can you pretend you are David Attenborough and narrate it as if it is a nature documentary. Make it short. If I do anything remotely interesting, make a big deal about it!\n\nDESCRIPTION:\nThe 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.",
"temperature": 0.7,
"top_k": 50,
"top_p": 0.9
}
)
# The mistralai/mistral-7b-instruct-v0.1 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/mistralai/mistral-7b-instruct-v0.1/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_3iN**********************************
This is your API token. Keep it to yourself.
Run mistralai/mistral-7b-instruct-v0.1 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": "mistralai/mistral-7b-instruct-v0.1:83b6a56e7c828e667f21fd596c338fd4f0039b46bcfa18d973e8e70e455fda70",
"input": {
"debug": false,
"max_new_tokens": 128,
"min_new_tokens": -1,
"prompt": "Here is a description of an image. Can you pretend you are David Attenborough and narrate it as if it is a nature documentary. Make it short. If I do anything remotely interesting, make a big deal about it!\\n\\nDESCRIPTION:\\nThe 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.",
"temperature": 0.7,
"top_k": 50,
"top_p": 0.9
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
In this fascinating observation, we see a remarkable display of human behavior. The person in the image is holding a red cup, poised to take a bite or drink. As they open their mouth wide, we can see the intricate workings of their teeth and jaw, a testament to the incredible adaptability of the human body. It's a sight to behold, a reminder of the complexities that make us who we are.
{
"id": "kq5cxp3bnhuf2zzdmxntojae7q",
"model": "mistralai/mistral-7b-instruct-v0.1",
"version": "83b6a56e7c828e667f21fd596c338fd4f0039b46bcfa18d973e8e70e455fda70",
"input": {
"debug": false,
"max_new_tokens": 128,
"min_new_tokens": -1,
"prompt": "Here is a description of an image. Can you pretend you are David Attenborough and narrate it as if it is a nature documentary. Make it short. If I do anything remotely interesting, make a big deal about it!\n\nDESCRIPTION:\nThe 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.",
"temperature": 0.7,
"top_k": 50,
"top_p": 0.9
},
"logs": "Your formatted prompt is:\n[INST] Here is a description of an image. Can you pretend you are David Attenborough and narrate it as if it is a nature documentary. Make it short. If I do anything remotely interesting, make a big deal about it!\nDESCRIPTION:\nThe 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. [/INST]\nDisabling loras\nNo loras were ever loaded, nothing to disable.\nNot using LoRA\nTokens: tensor([[ 1, 733, 16289, 28793, 4003, 349, 264, 5436, 302, 396,\n3469, 28723, 2418, 368, 19192, 368, 460, 4417, 5288, 269,\n23056, 304, 9819, 380, 378, 390, 513, 378, 349, 264,\n4735, 22054, 28723, 6746, 378, 2485, 28723, 1047, 315, 511,\n2424, 28601, 723, 5853, 28725, 1038, 264, 2032, 3215, 684,\n378, 28808, 13, 13, 25205, 10940, 28747, 13, 1014, 1338,\n297, 272, 3469, 349, 6632, 264, 2760, 6211, 582, 298,\n652, 5108, 28725, 7032, 652, 5108, 5335, 28725, 304, 9525,\n2570, 298, 1388, 264, 18082, 442, 4663, 477, 272, 6211,\n28723, 733, 28748, 16289, 28793]], device='cuda:0')\nThe 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.\nhostname: model-83b6a56e-94fe09a4acfa2b19-gpu-a40-5877ddbc7-zvvhq",
"output": [
"",
"In ",
"this ",
"fascinating ",
"",
"observation, ",
"we ",
"see ",
"a ",
"remarkable ",
"display ",
"of ",
"human ",
"",
"behavior. ",
"The ",
"person ",
"in ",
"the ",
"image ",
"is ",
"holding ",
"a ",
"red ",
"",
"cup, ",
"",
"poised ",
"to ",
"take ",
"a ",
"bite ",
"or ",
"",
"drink. ",
"As ",
"they ",
"open ",
"their ",
"mouth ",
"",
"wide, ",
"we ",
"can ",
"see ",
"the ",
"",
"intricate ",
"",
"workings ",
"of ",
"their ",
"teeth ",
"and ",
"",
"jaw, ",
"a ",
"",
"testament ",
"to ",
"the ",
"incredible ",
"",
"adaptability ",
"of ",
"the ",
"human ",
"",
"body. ",
"",
"",
"It's ",
"a ",
"sight ",
"to ",
"",
"",
"behold, ",
"a ",
"reminder ",
"of ",
"the ",
"",
"complexities ",
"that ",
"make ",
"us ",
"who ",
"we ",
"",
"",
"are."
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-12-01T22:09:36.73171Z",
"started_at": "2023-12-01T22:09:36.777509Z",
"completed_at": "2023-12-01T22:09:39.469188Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/kq5cxp3bnhuf2zzdmxntojae7q/cancel",
"get": "https://api.replicate.com/v1/predictions/kq5cxp3bnhuf2zzdmxntojae7q",
"stream": "https://streaming-api.svc.us.c.replicate.net/v1/predictions/kq5cxp3bnhuf2zzdmxntojae7q"
},
"metrics": {
"predict_time": 2.691679,
"total_time": 2.737478
}
}