defaultWrite me a poem about Machine Learning.
typetext
{
"max_new_tokens": 200,
"min_new_tokens": -1,
"prompt": "Write me a poem about Machine Learning.",
"repetition_penalty": 1.15,
"temperature": 0.7,
"top_k": 50,
"top_p": 0.95
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_SGI**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run google-deepmind/gemma-2b-it using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"google-deepmind/gemma-2b-it:dff94eaf770e1fc211e425a50b51baa8e4cac6c39ef074681f9e39d778773626",
{
input: {
max_new_tokens: 200,
min_new_tokens: -1,
prompt: "Write me a poem about Machine Learning.",
repetition_penalty: 1.15,
temperature: 0.7,
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_SGI**********************************
This is your API token. Keep it to yourself.
import replicate
Run google-deepmind/gemma-2b-it using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"google-deepmind/gemma-2b-it:dff94eaf770e1fc211e425a50b51baa8e4cac6c39ef074681f9e39d778773626",
input={
"max_new_tokens": 200,
"min_new_tokens": -1,
"prompt": "Write me a poem about Machine Learning.",
"repetition_penalty": 1.15,
"temperature": 0.7,
"top_k": 50,
"top_p": 0.95
}
)
# The google-deepmind/gemma-2b-it 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/google-deepmind/gemma-2b-it/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_SGI**********************************
This is your API token. Keep it to yourself.
Run google-deepmind/gemma-2b-it 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": "google-deepmind/gemma-2b-it:dff94eaf770e1fc211e425a50b51baa8e4cac6c39ef074681f9e39d778773626",
"input": {
"max_new_tokens": 200,
"min_new_tokens": -1,
"prompt": "Write me a poem about Machine Learning.",
"repetition_penalty": 1.15,
"temperature": 0.7,
"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.
Machines learn, they never sleep, Algorithms spin, a pattern to keep. From data's vast and ever-growing sea, They weave insights, a knowledge to believe. Supervised learning, a guiding hand, Training data, shaping the sand. Unsupervised, finding hidden gems, Clustering data, revealing their fears. Reinforcement, a learning spree, Learning from mistakes, a path to believe. Deep learning, a hidden black box, Extracting patterns, where once there was no shock. The future holds, a world transformed, With machines learning, we are transformed. A symphony of algorithms, a human guide, Igniting a future, where possibilities reside.
{
"id": "qgxsdm3blag42bc7qhceivtbma",
"model": "google-deepmind/gemma-2b-it",
"version": "dff94eaf770e1fc211e425a50b51baa8e4cac6c39ef074681f9e39d778773626",
"input": {
"max_new_tokens": 200,
"min_new_tokens": -1,
"prompt": "Write me a poem about Machine Learning.",
"repetition_penalty": 1.15,
"temperature": 0.7,
"top_k": 50,
"top_p": 0.95
},
"logs": "",
"output": [
"\n\n",
"",
"Machines ",
"",
"learn, ",
"they ",
"never ",
"",
"sleep,\n",
"",
"Algorithms ",
"",
"spin, ",
"a ",
"pattern ",
"to ",
"",
"keep.\n",
"",
"From ",
"",
"",
"data's ",
"vast ",
"and ",
"",
"",
"ever-growing ",
"",
"sea,\n",
"",
"They ",
"weave ",
"",
"insights, ",
"a ",
"knowledge ",
"to ",
"",
"believe.\n\n",
"",
"",
"Supervised ",
"",
"learning, ",
"a ",
"guiding ",
"",
"hand,\n",
"",
"Training ",
"",
"data, ",
"shaping ",
"the ",
"",
"sand.\n",
"",
"",
"",
"",
"Unsupervised, ",
"finding ",
"hidden ",
"",
"gems,\n",
"",
"Clustering ",
"",
"data, ",
"revealing ",
"their ",
"",
"fears.\n\n",
"",
"",
"",
"Reinforcement, ",
"a ",
"learning ",
"",
"spree,\n",
"",
"Learning ",
"from ",
"",
"mistakes, ",
"a ",
"path ",
"to ",
"",
"believe.\n",
"",
"Deep ",
"",
"learning, ",
"a ",
"hidden ",
"black ",
"",
"box,\n",
"",
"",
"Extracting ",
"",
"patterns, ",
"where ",
"once ",
"there ",
"was ",
"no ",
"",
"shock.\n\n",
"",
"The ",
"future ",
"",
"holds, ",
"a ",
"world ",
"",
"transformed,\n",
"",
"With ",
"machines ",
"",
"learning, ",
"we ",
"are ",
"",
"transformed.\n",
"",
"A ",
"symphony ",
"of ",
"",
"algorithms, ",
"a ",
"human ",
"",
"guide,\n",
"",
"",
"Igniting ",
"a ",
"",
"future, ",
"where ",
"possibilities ",
"",
"",
"reside."
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-02-21T20:43:45.881563Z",
"started_at": "2024-02-21T20:45:52.853206Z",
"completed_at": "2024-02-21T20:45:57.903047Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/qgxsdm3blag42bc7qhceivtbma/cancel",
"get": "https://api.replicate.com/v1/predictions/qgxsdm3blag42bc7qhceivtbma",
"stream": "https://streaming-api.svc.us.c.replicate.net/v1/streams/owoydi6awbq7kmd3to4i5nkixgazf7x6urlwumorpbcsp2bknm3q"
},
"metrics": {
"predict_time": 5.049841,
"total_time": 132.021484
}
}