typetext
{
"max_new_tokens": 1024,
"message": "Question:\nFarmer Brown has 60 animals on his farm, all either chickens or cows. He has twice as many chickens as cows. How many legs do the animals have, all together?\nAnswer:\nLet's think step by step.\n",
"temperature": 0.8,
"top_k": 50,
"top_p": 0.95
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_cXL**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run nateraw/gairmath-abel-7b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"nateraw/gairmath-abel-7b:bfcd64ec21f2d25007501f7133890f1e2753ee4c2d5920488f62da536eb8f00e",
{
input: {
max_new_tokens: 1024,
message: "Question:\nFarmer Brown has 60 animals on his farm, all either chickens or cows. He has twice as many chickens as cows. How many legs do the animals have, all together?\nAnswer:\nLet's think step by step.\n",
temperature: 0.8,
top_k: 50,
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_cXL**********************************
This is your API token. Keep it to yourself.
import replicate
Run nateraw/gairmath-abel-7b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"nateraw/gairmath-abel-7b:bfcd64ec21f2d25007501f7133890f1e2753ee4c2d5920488f62da536eb8f00e",
input={
"max_new_tokens": 1024,
"message": "Question:\nFarmer Brown has 60 animals on his farm, all either chickens or cows. He has twice as many chickens as cows. How many legs do the animals have, all together?\nAnswer:\nLet's think step by step.\n",
"temperature": 0.8,
"top_k": 50,
"top_p": 0.95
}
)
# The nateraw/gairmath-abel-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/nateraw/gairmath-abel-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_cXL**********************************
This is your API token. Keep it to yourself.
Run nateraw/gairmath-abel-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": "nateraw/gairmath-abel-7b:bfcd64ec21f2d25007501f7133890f1e2753ee4c2d5920488f62da536eb8f00e",
"input": {
"max_new_tokens": 1024,
"message": "Question:\\nFarmer Brown has 60 animals on his farm, all either chickens or cows. He has twice as many chickens as cows. How many legs do the animals have, all together?\\nAnswer:\\nLet\'s think step by step.\\n",
"temperature": 0.8,
"top_k": 50,
"top_p": 0.95
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
1. The problem states that Farmer Brown has 60 animals on his farm, all either chickens or cows. He has twice as many chickens as cows. We need to find out how many legs the animals have in total. 2. Let's assume the number of cows is x. Since Farmer Brown has twice as many chickens as cows, the number of chickens is 2x. 3. The total number of animals is 60, so we can write the equation x + 2x = 60. 4. Simplifying this equation, we get 3x = 60. 5. Dividing both sides by 3, we find x = 20. 6. Therefore, the number of cows is 20. 7. Since each cow has 4 legs and each chicken has 2 legs, the total number of legs is 4 * 20 + 2 * 60 = 80 + 120 = 200. 8. [Final solution] Thus, the animals have a total of 200 legs. #### 200
{
"id": "yav75qlbw6matrhjoejbyg65oi",
"model": "nateraw/gairmath-abel-7b",
"version": "bfcd64ec21f2d25007501f7133890f1e2753ee4c2d5920488f62da536eb8f00e",
"input": {
"max_new_tokens": 1024,
"message": "Question:\nFarmer Brown has 60 animals on his farm, all either chickens or cows. He has twice as many chickens as cows. How many legs do the animals have, all together?\nAnswer:\nLet's think step by step.\n",
"temperature": 0.8,
"top_k": 50,
"top_p": 0.95
},
"logs": "",
"output": [
"",
"",
"1. ",
"The ",
"problem ",
"states ",
"that ",
"",
"Farmer ",
"Brown ",
"has ",
"",
"",
"60 ",
"animals ",
"on ",
"his ",
"",
"farm, ",
"all ",
"either ",
"",
"",
"chickens ",
"or ",
"",
"",
"cows. ",
"He ",
"has ",
"twice ",
"as ",
"many ",
"",
"",
"chickens ",
"as ",
"",
"",
"cows. ",
"We ",
"need ",
"to ",
"find ",
"out ",
"how ",
"many ",
"legs ",
"the ",
"animals ",
"have ",
"in ",
"",
"total.\n",
"\n",
"",
"",
"2. ",
"",
"",
"Let's ",
"assume ",
"the ",
"number ",
"of ",
"",
"cows ",
"is ",
"",
"x. ",
"Since ",
"",
"Farmer ",
"Brown ",
"has ",
"twice ",
"as ",
"many ",
"",
"",
"chickens ",
"as ",
"",
"",
"cows, ",
"the ",
"number ",
"of ",
"",
"",
"chickens ",
"is ",
"",
"",
"",
"2x.\n",
"\n",
"",
"",
"3. ",
"The ",
"total ",
"number ",
"of ",
"animals ",
"is ",
"",
"",
"",
"60, ",
"so ",
"we ",
"can ",
"write ",
"the ",
"equation ",
"x ",
"+ ",
"",
"",
"2x ",
"= ",
"",
"",
"",
"60.\n",
"\n",
"",
"",
"4. ",
"",
"",
"Simplifying ",
"this ",
"",
"equation, ",
"we ",
"get ",
"",
"",
"3x ",
"= ",
"",
"",
"",
"60.\n",
"\n",
"",
"",
"5. ",
"",
"",
"Dividing ",
"both ",
"sides ",
"by ",
"",
"",
"3, ",
"we ",
"find ",
"x ",
"= ",
"",
"",
"",
"20.\n",
"\n",
"",
"",
"6. ",
"",
"Therefore, ",
"the ",
"number ",
"of ",
"",
"cows ",
"is ",
"",
"",
"",
"20.\n",
"\n",
"",
"",
"7. ",
"Since ",
"each ",
"cow ",
"has ",
"",
"4 ",
"legs ",
"and ",
"each ",
"",
"chicken ",
"has ",
"",
"2 ",
"",
"legs, ",
"the ",
"total ",
"number ",
"of ",
"legs ",
"is ",
"",
"4 ",
"* ",
"",
"",
"20 ",
"+ ",
"",
"2 ",
"* ",
"",
"",
"60 ",
"= ",
"",
"",
"80 ",
"+ ",
"",
"",
"",
"120 ",
"= ",
"",
"",
"",
"",
"200.\n",
"\n",
"",
"",
"8. ",
"",
"[Final ",
"",
"solution] ",
"",
"Thus, ",
"the ",
"animals ",
"have ",
"a ",
"total ",
"of ",
"",
"",
"",
"200 ",
"",
"legs. ",
"#### ",
"",
"",
"",
"",
"200"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-09-25T17:38:13.680717Z",
"started_at": "2023-09-25T17:38:13.631305Z",
"completed_at": "2023-09-25T17:38:28.668384Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/yav75qlbw6matrhjoejbyg65oi/cancel",
"get": "https://api.replicate.com/v1/predictions/yav75qlbw6matrhjoejbyg65oi"
},
"metrics": {
"predict_time": 15.037079,
"total_time": 14.987667
}
}