defaultWrite me a poem about Machine Learning.
typetext
{
"max_new_tokens": 128,
"prompt": "Write me a poem about Machine Learning.",
"repetition_penalty": 1.2,
"temperature": 0.6,
"top_k": 50,
"top_p": 0.9
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_YIi**********************************
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-2-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-2-2b-it:ff924e24b20727e4e04b9721b403b1a75500b7b8b934714ed2b34afc6de69673",
{
input: {
max_new_tokens: 128,
prompt: "Write me a poem about Machine Learning.",
repetition_penalty: 1.2,
temperature: 0.6,
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_YIi**********************************
This is your API token. Keep it to yourself.
import replicate
Run google-deepmind/gemma-2-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-2-2b-it:ff924e24b20727e4e04b9721b403b1a75500b7b8b934714ed2b34afc6de69673",
input={
"max_new_tokens": 128,
"prompt": "Write me a poem about Machine Learning.",
"repetition_penalty": 1.2,
"temperature": 0.6,
"top_k": 50,
"top_p": 0.9
}
)
# The google-deepmind/gemma-2-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-2-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_YIi**********************************
This is your API token. Keep it to yourself.
Run google-deepmind/gemma-2-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-2-2b-it:ff924e24b20727e4e04b9721b403b1a75500b7b8b934714ed2b34afc6de69673",
"input": {
"max_new_tokens": 128,
"prompt": "Write me a poem about Machine Learning.",
"repetition_penalty": 1.2,
"temperature": 0.6,
"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.
A labyrinth of data, vast and deep, Where patterns hide, secrets to keep. Machine learning, with algorithms bright, Unveils the truth through logic's light. From simple tasks, it starts its quest, To solve complex problems, put them to test. With each iteration, knowledge grows, As models learn, their wisdom shows. Neural networks, like brains they mimic, Connecting nodes, information trickling. Deep learning dives into unknown terrain, Extracting insights from unseen domain. Predictive power, in every stride, Forecasting future, where trends reside
{
"id": "gt05haav51rga0ch1j4bmvgxxm",
"model": "google-deepmind/gemma-2-2b-it",
"version": "ff924e24b20727e4e04b9721b403b1a75500b7b8b934714ed2b34afc6de69673",
"input": {
"max_new_tokens": 128,
"prompt": "Write me a poem about Machine Learning.",
"repetition_penalty": 1.2,
"temperature": 0.6,
"top_k": 50,
"top_p": 0.9
},
"logs": "",
"output": [
"\n\n",
"",
"A ",
"labyrinth ",
"of ",
"",
"data, ",
"vast ",
"and ",
"",
"deep,\n",
"",
"Where ",
"patterns ",
"",
"hide, ",
"secrets ",
"to ",
"",
"keep.\n",
"",
"Machine ",
"",
"learning, ",
"with ",
"algorithms ",
"",
"bright,\n",
"",
"",
"",
"Unveils ",
"the ",
"truth ",
"through ",
"",
"",
"logic's ",
"",
"light.\n\n",
"",
"From ",
"simple ",
"",
"tasks, ",
"it ",
"starts ",
"its ",
"",
"quest,\n",
"",
"To ",
"solve ",
"complex ",
"",
"problems, ",
"put ",
"them ",
"to ",
"",
"test.\n",
"",
"With ",
"each ",
"",
"iteration, ",
"knowledge ",
"",
"grows,\n",
"",
"As ",
"models ",
"",
"learn, ",
"their ",
"wisdom ",
"",
"shows. ",
"\n\n",
"",
"Neural ",
"",
"networks, ",
"like ",
"brains ",
"they ",
"",
"mimic,\n",
"",
"Connecting ",
"",
"nodes, ",
"information ",
"",
"",
"trickling.\n",
"",
"Deep ",
"learning ",
"dives ",
"into ",
"unknown ",
"",
"terrain,\n",
"",
"",
"Extracting ",
"insights ",
"from ",
"unseen ",
"",
"domain.\n\n",
"",
"",
"Predictive ",
"",
"power, ",
"in ",
"every ",
"",
"stride,\n",
"",
"",
"Forecasting ",
"",
"future, ",
"where ",
"trends ",
"reside"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-08-01T06:02:28.52Z",
"started_at": "2024-08-01T06:02:28.531674Z",
"completed_at": "2024-08-01T06:02:36.631282Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/gt05haav51rga0ch1j4bmvgxxm/cancel",
"get": "https://api.replicate.com/v1/predictions/gt05haav51rga0ch1j4bmvgxxm",
"stream": "https://streaming-api.svc.us-central1.g.replicate.net/v1/streams/zojpfmxl7atl7qwe4flloaempxtxmfgxnd42ob5ic6qaztomgu5q",
"web": "https://replicate.com/p/gt05haav51rga0ch1j4bmvgxxm"
},
"metrics": {
"predict_time": 8.099607931,
"total_time": 8.111282
}
}