typetext
{
"max_length": 50,
"prompt": "Answer the following yes/no question by reasoning step by step. Can a dog drive a car?",
"repetition_penalty": 1,
"temperature": "0.7",
"top_p": "0.95"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_BeR**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run replicate/flan-t5-xl using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"replicate/flan-t5-xl:1457f256622cd45415aa70c02105a917b39dc96e58601d7c2df5a30d2e3092e7",
{
input: {
max_length: 50,
prompt: "Answer the following yes/no question by reasoning step by step. Can a dog drive a car?",
repetition_penalty: 1,
temperature: "0.7",
top_p: "0.95"
}
}
);
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_BeR**********************************
This is your API token. Keep it to yourself.
import replicate
Run replicate/flan-t5-xl using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"replicate/flan-t5-xl:1457f256622cd45415aa70c02105a917b39dc96e58601d7c2df5a30d2e3092e7",
input={
"max_length": 50,
"prompt": "Answer the following yes/no question by reasoning step by step. Can a dog drive a car?",
"repetition_penalty": 1,
"temperature": "0.7",
"top_p": "0.95"
}
)
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_BeR**********************************
This is your API token. Keep it to yourself.
Run replicate/flan-t5-xl 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": "replicate/flan-t5-xl:1457f256622cd45415aa70c02105a917b39dc96e58601d7c2df5a30d2e3092e7",
"input": {
"max_length": 50,
"prompt": "Answer the following yes/no question by reasoning step by step. Can a dog drive a car?",
"repetition_penalty": 1,
"temperature": "0.7",
"top_p": "0.95"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Dogs do not have a drivers license nor can they operate a car. Therefore, the final answer is no.
{
"id": "dviccvpuavfl3iuu3guhfpe2ju",
"model": "replicate/flan-t5-xl",
"version": "1457f256622cd45415aa70c02105a917b39dc96e58601d7c2df5a30d2e3092e7",
"input": {
"max_length": 50,
"prompt": "Answer the following yes/no question by reasoning step by step. Can a dog drive a car?",
"repetition_penalty": 1,
"temperature": "0.7",
"top_p": "0.95"
},
"logs": "",
"output": [
"Dogs do not have a drivers license nor can they operate a car. Therefore, the final answer is no."
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-03-03T06:20:57.605544Z",
"started_at": "2023-03-03T06:25:26.400286Z",
"completed_at": "2023-03-03T06:25:29.282546Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/dviccvpuavfl3iuu3guhfpe2ju/cancel",
"get": "https://api.replicate.com/v1/predictions/dviccvpuavfl3iuu3guhfpe2ju"
},
"metrics": {
"predict_time": 2.88226,
"total_time": 271.677002
}
}