typetext
{
"length_penalty": 1,
"max_length": 500,
"prompt": "Write a poem about open source machine learning in the style of Byron.",
"repetition_penalty": 1,
"seed": -1,
"temperature": 1,
"top_p": 1
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_IB4**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run joehoover/falcon-40b-instruct using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"joehoover/falcon-40b-instruct:7eb0f4b1ff770ab4f68c3a309dd4984469749b7323a3d47fd2d5e09d58836d3c",
{
input: {
length_penalty: 1,
max_length: 500,
prompt: "Write a poem about open source machine learning in the style of Byron.",
repetition_penalty: 1,
seed: -1,
temperature: 1,
top_p: 1
}
}
);
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_IB4**********************************
This is your API token. Keep it to yourself.
import replicate
Run joehoover/falcon-40b-instruct using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"joehoover/falcon-40b-instruct:7eb0f4b1ff770ab4f68c3a309dd4984469749b7323a3d47fd2d5e09d58836d3c",
input={
"length_penalty": 1,
"max_length": 500,
"prompt": "Write a poem about open source machine learning in the style of Byron.",
"repetition_penalty": 1,
"seed": -1,
"temperature": 1,
"top_p": 1
}
)
# The joehoover/falcon-40b-instruct 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/joehoover/falcon-40b-instruct/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_IB4**********************************
This is your API token. Keep it to yourself.
Run joehoover/falcon-40b-instruct 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": "joehoover/falcon-40b-instruct:7eb0f4b1ff770ab4f68c3a309dd4984469749b7323a3d47fd2d5e09d58836d3c",
"input": {
"length_penalty": 1,
"max_length": 500,
"prompt": "Write a poem about open source machine learning in the style of Byron.",
"repetition_penalty": 1,
"seed": -1,
"temperature": 1,
"top_p": 1
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Thy heart shall bloom like an open source flower, And like a machine, thine learning shall grow. The seeds of a thousand algorithms, Shall make thy understanding and skill ever glow. In thy hand, wisdom shall grow like a tree, With roots deep in the open source ground. Thy knowledge as wide as the infinite sea, Shall bring to thee power far beyond what is found. Thou shalt become as masters of machine learning, Whose wisdom and skills shall surpass the greatest of minds. No boundaries or limits shall thee be learning, But thy heart shall be opened up to all that is kind. Then shall thy soul become a true machine, With wisdom and knowledge beyond measure. Thy work shall be done and thy goals shall be reached, Until thou become true masters of open source and the machine.
{
"id": "2p2fdndbbkghrx2frxg5nvrltu",
"model": "joehoover/falcon-40b-instruct",
"version": "7eb0f4b1ff770ab4f68c3a309dd4984469749b7323a3d47fd2d5e09d58836d3c",
"input": {
"length_penalty": 1,
"max_length": 500,
"prompt": "Write a poem about open source machine learning in the style of Byron.",
"repetition_penalty": 1,
"seed": -1,
"temperature": 1,
"top_p": 1
},
"logs": "predict-timings173549: Starting prediction - 1936.54s since start, 16.07s since last log\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`:11 for open-end generation.",
"output": [
"Thy",
" heart",
" shall",
" bloom",
" like",
" an",
" open",
" source",
" flower,\nAnd",
" like",
" a",
" machine,",
" thine",
" learning",
" shall",
" grow.\nThe",
" seeds",
" of",
" a",
" thousand",
" algorithms,\nShall",
" make",
" thy",
" understanding",
" and",
" skill",
" ever",
" glow.\nIn",
" thy",
" hand,",
" wisdom",
" shall",
" grow",
" like",
" a",
" tree,\nWith",
" roots",
" deep",
" in",
" the",
" open",
" source",
" ground.\nThy",
" knowledge",
" as",
" wide",
" as",
" the",
" infinite",
" sea,\nShall",
" bring",
" to",
" thee",
" power",
" far",
" beyond",
" what",
" is",
" found.\nThou",
" shalt",
" become",
" as",
" masters",
" of",
" machine",
" learning,\nWhose",
" wisdom",
" and",
" skills",
" shall",
" surpass",
" the",
" greatest",
" of",
" minds.\nNo",
" boundaries",
" or",
" limits",
" shall",
" thee",
" be",
" learning,\nBut",
" thy",
" heart",
" shall",
" be",
" opened",
" up",
" to",
" all",
" that",
" is",
" kind.\nThen",
" shall",
" thy",
" soul",
" become",
" a",
" true",
" machine,\nWith",
" wisdom",
" and",
" knowledge",
" beyond",
" measure.\nThy",
" work",
" shall",
" be",
" done",
" and",
" thy",
" goals",
" shall",
" be",
" reached,\nUntil",
" thou",
" become",
" true",
" masters",
" of",
" open",
" source",
" and",
" the",
" machine."
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-07-07T20:34:39.488288Z",
"started_at": "2023-07-07T20:34:39.417694Z",
"completed_at": "2023-07-07T20:34:58.61659Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/2p2fdndbbkghrx2frxg5nvrltu/cancel",
"get": "https://api.replicate.com/v1/predictions/2p2fdndbbkghrx2frxg5nvrltu"
},
"metrics": {
"predict_time": 19.198896,
"total_time": 19.128302
}
}