typetext
{
"debug": false,
"max_new_tokens": 128,
"min_new_tokens": -1,
"prompt": "Input:\nAmanda: I just saw an elephant.\nJerry: Wow! Where are you?\nAmanda: I'm in Newark New Jersey. But also I'm not wearing my glasses. [/INST]\n\nSummary: ",
"temperature": 0.75,
"top_k": 50,
"top_p": 0.9
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_67S**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run cbh123/samsum using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cbh123/samsum:2d1f4bf15916a2a93bc1068e72da42a71a05a9a6bfa3cd8f8d7077e22d83605f",
{
input: {
debug: false,
max_new_tokens: 128,
min_new_tokens: -1,
prompt: "Input:\nAmanda: I just saw an elephant.\nJerry: Wow! Where are you?\nAmanda: I'm in Newark New Jersey. But also I'm not wearing my glasses. [/INST]\n\nSummary: ",
temperature: 0.75,
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_67S**********************************
This is your API token. Keep it to yourself.
import replicate
Run cbh123/samsum using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cbh123/samsum:2d1f4bf15916a2a93bc1068e72da42a71a05a9a6bfa3cd8f8d7077e22d83605f",
input={
"debug": False,
"max_new_tokens": 128,
"min_new_tokens": -1,
"prompt": "Input:\nAmanda: I just saw an elephant.\nJerry: Wow! Where are you?\nAmanda: I'm in Newark New Jersey. But also I'm not wearing my glasses. [/INST]\n\nSummary: ",
"temperature": 0.75,
"top_k": 50,
"top_p": 0.9
}
)
# The cbh123/samsum 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/cbh123/samsum/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_67S**********************************
This is your API token. Keep it to yourself.
Run cbh123/samsum 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": "cbh123/samsum:2d1f4bf15916a2a93bc1068e72da42a71a05a9a6bfa3cd8f8d7077e22d83605f",
"input": {
"debug": false,
"max_new_tokens": 128,
"min_new_tokens": -1,
"prompt": "Input:\\nAmanda: I just saw an elephant.\\nJerry: Wow! Where are you?\\nAmanda: I\'m in Newark New Jersey. But also I\'m not wearing my glasses. [/INST]\\n\\nSummary: ",
"temperature": 0.75,
"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.
Amanda saw an elephant in Newark, New Jersey..</s>
{
"id": "m2oc6m3bm54vndgg5m4imyzv4a",
"model": "cbh123/samsum",
"version": "2d1f4bf15916a2a93bc1068e72da42a71a05a9a6bfa3cd8f8d7077e22d83605f",
"input": {
"debug": false,
"max_new_tokens": 128,
"min_new_tokens": -1,
"prompt": "Input:\nAmanda: I just saw an elephant.\nJerry: Wow! Where are you?\nAmanda: I'm in Newark New Jersey. But also I'm not wearing my glasses. [/INST]\n\nSummary: ",
"temperature": 0.75,
"top_k": 50,
"top_p": 0.9
},
"logs": "Your formatted prompt is:\nInput:\nAmanda: I just saw an elephant.\nJerry: Wow! Where are you?\nAmanda: I'm in Newark New Jersey. But also I'm not wearing my glasses. [/INST]\nSummary:",
"output": [
" Am",
"anda",
" saw",
" an",
" ele",
"ph",
"ant",
" in",
" New",
"ark",
",",
" New",
" Jersey",
".",
".</s>"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-09-01T00:55:04.381166Z",
"started_at": "2023-09-01T00:59:09.626911Z",
"completed_at": "2023-09-01T00:59:10.342719Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/m2oc6m3bm54vndgg5m4imyzv4a/cancel",
"get": "https://api.replicate.com/v1/predictions/m2oc6m3bm54vndgg5m4imyzv4a"
},
"metrics": {
"predict_time": 0.715808,
"total_time": 245.961553
}
}