You're looking at a specific version of this model. Jump to the model overview.
cjwbw /starcoder2-15b:d67b7d32
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run cjwbw/starcoder2-15b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cjwbw/starcoder2-15b:d67b7d32b63bb8a2cf6b95c523921408e38ce7d7228fdff7b1eb636dc2c5ecd8",
{
input: {
top_k: -1,
top_p: 0.95,
prompt: "def print_hello_world():",
temperature: 0.01,
max_new_tokens: 100
}
}
);
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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run cjwbw/starcoder2-15b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cjwbw/starcoder2-15b:d67b7d32b63bb8a2cf6b95c523921408e38ce7d7228fdff7b1eb636dc2c5ecd8",
input={
"top_k": -1,
"top_p": 0.95,
"prompt": "def print_hello_world():",
"temperature": 0.01,
"max_new_tokens": 100
}
)
# The cjwbw/starcoder2-15b 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/cjwbw/starcoder2-15b/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=<paste-your-token-here>
Find your API token in your account settings.
Run cjwbw/starcoder2-15b 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": "cjwbw/starcoder2-15b:d67b7d32b63bb8a2cf6b95c523921408e38ce7d7228fdff7b1eb636dc2c5ecd8",
"input": {
"top_k": -1,
"top_p": 0.95,
"prompt": "def print_hello_world():",
"temperature": 0.01,
"max_new_tokens": 100
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
Each run costs approximately $0.99. Alternatively, try out our featured models for free.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2024-03-20T10:45:37.200300Z",
"created_at": "2024-03-20T10:44:06.928414Z",
"data_removed": false,
"error": null,
"id": "45gxk6lbioeuqmjignlrrpnvke",
"input": {
"top_k": -1,
"top_p": 0.95,
"prompt": "def print_hello_world():",
"temperature": 0.01,
"max_new_tokens": 100
},
"logs": "/root/.pyenv/versions/3.11.7/lib/python3.11/site-packages/transformers/generation/configuration_utils.py:492: UserWarning: `do_sample` is set to `False`. However, `temperature` is set to `0.01` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`.\nwarnings.warn(\n/root/.pyenv/versions/3.11.7/lib/python3.11/site-packages/transformers/generation/configuration_utils.py:497: UserWarning: `do_sample` is set to `False`. However, `top_p` is set to `0.95` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_p`.\nwarnings.warn(\n/root/.pyenv/versions/3.11.7/lib/python3.11/site-packages/transformers/generation/configuration_utils.py:509: UserWarning: `do_sample` is set to `False`. However, `top_k` is set to `-1` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_k`.\nwarnings.warn(\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`:50256 for open-end generation.",
"metrics": {
"predict_time": 6.309635,
"total_time": 90.271886
},
"output": [
"def ",
"print_hello_world():\n ",
" ",
"",
"",
"print(\"Hello ",
"",
"World\")\n",
"\n",
"",
"",
"",
"",
"",
"",
"print_hello_world()\n",
"\n",
"",
"# ",
"+\n",
"",
"# ",
"",
"",
"",
"",
"",
"",
"",
"1.1.2.1\n",
"",
"# ",
"",
"",
"",
"",
"",
"",
"",
"1.1.2.2\n",
"",
"# ",
"",
"",
"",
"",
"",
"",
"",
"1.1.2.3\n",
"",
"# ",
"",
"",
"",
"",
"",
"",
"",
"1.1.2.4\n",
"",
"# ",
"",
"",
"",
"",
"",
"",
"",
"1.1.2.5\n",
"",
"# ",
"",
"",
"",
"",
"",
"",
"",
"1.1.2.6\n",
"",
"# ",
"",
"",
"",
"",
"",
"",
"",
"1.1.2.7\n",
"",
"# ",
"",
"",
"",
"",
"",
"",
"",
"1.1.2.8\n",
"",
"#"
],
"started_at": "2024-03-20T10:45:30.890665Z",
"status": "succeeded",
"urls": {
"stream": "https://streaming-api.svc.us.c.replicate.net/v1/streams/asnnem5s67ulfvuvjl54se4jwb6fiafieowiwzchnk365bqd7sdq",
"get": "https://api.replicate.com/v1/predictions/45gxk6lbioeuqmjignlrrpnvke",
"cancel": "https://api.replicate.com/v1/predictions/45gxk6lbioeuqmjignlrrpnvke/cancel"
},
"version": "d67b7d32b63bb8a2cf6b95c523921408e38ce7d7228fdff7b1eb636dc2c5ecd8"
}
/root/.pyenv/versions/3.11.7/lib/python3.11/site-packages/transformers/generation/configuration_utils.py:492: UserWarning: `do_sample` is set to `False`. However, `temperature` is set to `0.01` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`.
warnings.warn(
/root/.pyenv/versions/3.11.7/lib/python3.11/site-packages/transformers/generation/configuration_utils.py:497: UserWarning: `do_sample` is set to `False`. However, `top_p` is set to `0.95` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_p`.
warnings.warn(
/root/.pyenv/versions/3.11.7/lib/python3.11/site-packages/transformers/generation/configuration_utils.py:509: UserWarning: `do_sample` is set to `False`. However, `top_k` is set to `-1` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_k`.
warnings.warn(
The 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.
Setting `pad_token_id` to `eos_token_id`:50256 for open-end generation.