meta /llama-2-13b-chat:56acad22
Input
Run this model in Node.js with one line of code:
npx create-replicate --model=meta/llama-2-13b-chat
or set up a project from scratch
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 meta/llama-2-13b-chat using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"meta/llama-2-13b-chat:56acad22679f6b95d6e45c78309a2b50a670d5ed29a37dd73d182e89772c02f1",
{
input: {
debug: false,
top_p: 0.2,
prompt: "User: Respond to this question only based on the information provided here. Cats like dogs, and dogs like rabbits. Cats like anything that dogs like. I really really dislike rabbits. How do cats feel about rabbits?\nAssistant:",
max_length: 500,
temperature: 0.75,
repetition_penalty: 1
}
}
);
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 meta/llama-2-13b-chat using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"meta/llama-2-13b-chat:56acad22679f6b95d6e45c78309a2b50a670d5ed29a37dd73d182e89772c02f1",
input={
"debug": False,
"top_p": 0.2,
"prompt": "User: Respond to this question only based on the information provided here. Cats like dogs, and dogs like rabbits. Cats like anything that dogs like. I really really dislike rabbits. How do cats feel about rabbits?\nAssistant:",
"max_length": 500,
"temperature": 0.75,
"repetition_penalty": 1
}
)
# The meta/llama-2-13b-chat 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/meta/llama-2-13b-chat/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 meta/llama-2-13b-chat 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": "56acad22679f6b95d6e45c78309a2b50a670d5ed29a37dd73d182e89772c02f1",
"input": {
"debug": false,
"top_p": 0.2,
"prompt": "User: Respond to this question only based on the information provided here. Cats like dogs, and dogs like rabbits. Cats like anything that dogs like. I really really dislike rabbits. How do cats feel about rabbits?\\nAssistant:",
"max_length": 500,
"temperature": 0.75,
"repetition_penalty": 1
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Based on the information provided, cats like dogs, and dogs like rabbits. Since cats like anything that dogs like, it can be inferred that cats also like rabbits. However, you mentioned that you really dislike rabbits, so it's possible that cats may not share the same sentiment.
{
"completed_at": "2023-07-17T03:34:33.880478Z",
"created_at": "2023-07-17T03:34:29.813290Z",
"data_removed": false,
"error": null,
"id": "fqch35bbyrcrj7zhl7zxb5k6ha",
"input": {
"top_p": 0.2,
"prompt": "User: Respond to this question only based on the information provided here. Cats like dogs, and dogs like rabbits. Cats like anything that dogs like. I really really dislike rabbits. How do cats feel about rabbits?\nAssistant:",
"max_length": 500,
"temperature": 0.75,
"repetition_penalty": 1
},
"logs": null,
"metrics": {
"predict_time": 4.098904,
"total_time": 4.067188
},
"output": [
"Based",
" on",
" the",
" information",
" provided,",
" cats",
" like",
" dogs,",
" and",
" dogs",
" like",
" rabbits.",
" Since",
" cats",
" like",
" anything",
" that",
" dogs",
" like,",
" it",
" can",
" be",
" inferred",
" that",
" cats",
" also",
" like",
" rabbits.",
" However,",
" you",
" mentioned",
" that",
" you",
" really",
" dislike",
" rabbits,",
" so",
" it's",
" possible",
" that",
" cats",
" may",
" not",
" share",
" the",
" same",
" sentiment."
],
"started_at": "2023-07-17T03:34:29.781574Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/fqch35bbyrcrj7zhl7zxb5k6ha",
"cancel": "https://api.replicate.com/v1/predictions/fqch35bbyrcrj7zhl7zxb5k6ha/cancel"
},
"version": "56acad22679f6b95d6e45c78309a2b50a670d5ed29a37dd73d182e89772c02f1"
}
Generated in