Import and set up the client:
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run anotherjesse/trained-cpu using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"anotherjesse/trained-cpu:f9d74404bd7b3c6957e59302a292cbb6b7c182bca2d4ad0131fd6e750c749db2",
{
input: {
text: "what"
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Run anotherjesse/trained-cpu using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"anotherjesse/trained-cpu:f9d74404bd7b3c6957e59302a292cbb6b7c182bca2d4ad0131fd6e750c749db2",
input={
"text": "what"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
Run anotherjesse/trained-cpu 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": "anotherjesse/trained-cpu:f9d74404bd7b3c6957e59302a292cbb6b7c182bca2d4ad0131fd6e750c749db2",
"input": {
"text": "what"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.