Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
nateraw /llama-2-7b-paraphrase-v1:17b76fbd
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 nateraw/llama-2-7b-paraphrase-v1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"nateraw/llama-2-7b-paraphrase-v1:17b76fbd699fcd4476b6d7292de8bfd1ee1b219f7ed81f0395da0631d00850cc",
{
input: {
debug: false,
top_p: 0.9,
prompt: "My favorite color is red, but I also like black.\n",
temperature: 0.75,
return_logits: false,
max_new_tokens: 128,
min_new_tokens: -1,
repetition_penalty: 1.15
}
}
);
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 nateraw/llama-2-7b-paraphrase-v1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"nateraw/llama-2-7b-paraphrase-v1:17b76fbd699fcd4476b6d7292de8bfd1ee1b219f7ed81f0395da0631d00850cc",
input={
"debug": False,
"top_p": 0.9,
"prompt": "My favorite color is red, but I also like black.\n",
"temperature": 0.75,
"return_logits": False,
"max_new_tokens": 128,
"min_new_tokens": -1,
"repetition_penalty": 1.15
}
)
# The nateraw/llama-2-7b-paraphrase-v1 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/llama-2-7b-paraphrase-v1/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 nateraw/llama-2-7b-paraphrase-v1 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/llama-2-7b-paraphrase-v1:17b76fbd699fcd4476b6d7292de8bfd1ee1b219f7ed81f0395da0631d00850cc",
"input": {
"debug": false,
"top_p": 0.9,
"prompt": "My favorite color is red, but I also like black.\\n",
"temperature": 0.75,
"return_logits": false,
"max_new_tokens": 128,
"min_new_tokens": -1,
"repetition_penalty": 1.15
}
}' \
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.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2023-11-14T23:30:18.379928Z",
"created_at": "2023-11-14T23:30:09.612573Z",
"data_removed": false,
"error": null,
"id": "ullqrudbck3zk5l5fsuu7ayliq",
"input": {
"debug": false,
"top_k": 50,
"top_p": 0.9,
"prompt": "My favorite color is red, but I also like black.\n",
"temperature": 0.75,
"max_new_tokens": 128,
"min_new_tokens": -1
},
"logs": "Your formatted prompt is:\nMy favorite color is red, but I also like black.\ncorrect lora is already loaded\nOverall initialize_peft took 0.000\nExllama: False\nINFO 11-14 23:30:17 async_llm_engine.py:371] Received request 0: prompt: 'My favorite color is red, but I also like black.\\n', sampling params: SamplingParams(n=1, best_of=1, presence_penalty=0.0, frequency_penalty=1.0, temperature=0.75, top_p=0.9, top_k=50, use_beam_search=False, length_penalty=1.0, early_stopping=False, stop=['</s>'], ignore_eos=False, max_tokens=128, logprobs=None, skip_special_tokens=True), prompt token ids: None.\nINFO 11-14 23:30:17 llm_engine.py:631] Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 0.0 tokens/s, Running: 1 reqs, Swapped: 0 reqs, Pending: 0 reqs, GPU KV cache usage: 0.0%, CPU KV cache usage: 0.0%\nINFO 11-14 23:30:18 async_llm_engine.py:111] Finished request 0.\nhostname: model-hs-73001d65-da72d39bf79629ac-gpu-a40-85ddd9ccc9-97bzw",
"metrics": {
"predict_time": 0.414644,
"total_time": 8.767355
},
"output": [
"Red",
" is",
" my",
" favorite",
" color",
",",
" but",
" I",
" also",
" have",
" a",
" soft",
" spot",
" for",
" black",
".",
""
],
"started_at": "2023-11-14T23:30:17.965284Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/ullqrudbck3zk5l5fsuu7ayliq",
"cancel": "https://api.replicate.com/v1/predictions/ullqrudbck3zk5l5fsuu7ayliq/cancel"
},
"version": "17b76fbd699fcd4476b6d7292de8bfd1ee1b219f7ed81f0395da0631d00850cc"
}
Your formatted prompt is:
My favorite color is red, but I also like black.
correct lora is already loaded
Overall initialize_peft took 0.000
Exllama: False
INFO 11-14 23:30:17 async_llm_engine.py:371] Received request 0: prompt: 'My favorite color is red, but I also like black.\n', sampling params: SamplingParams(n=1, best_of=1, presence_penalty=0.0, frequency_penalty=1.0, temperature=0.75, top_p=0.9, top_k=50, use_beam_search=False, length_penalty=1.0, early_stopping=False, stop=['</s>'], ignore_eos=False, max_tokens=128, logprobs=None, skip_special_tokens=True), prompt token ids: None.
INFO 11-14 23:30:17 llm_engine.py:631] Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 0.0 tokens/s, Running: 1 reqs, Swapped: 0 reqs, Pending: 0 reqs, GPU KV cache usage: 0.0%, CPU KV cache usage: 0.0%
INFO 11-14 23:30:18 async_llm_engine.py:111] Finished request 0.
hostname: model-hs-73001d65-da72d39bf79629ac-gpu-a40-85ddd9ccc9-97bzw