typefile
{
"image": "https://replicate.delivery/pbxt/JozWvEjU8HJMutd7vXzvdCfhMV9G9mrzNKEyF5bawHYiUld4/bird.jpeg"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_aT6**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run anotherjesse/fastai-bird using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"anotherjesse/fastai-bird:c0126c0fbc1775359a65d6eb7f1ef955610ab995e7f24ed5cbd4f747187948c8",
{
input: {
image: "https://replicate.delivery/pbxt/JozWvEjU8HJMutd7vXzvdCfhMV9G9mrzNKEyF5bawHYiUld4/bird.jpeg"
}
}
);
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_aT6**********************************
This is your API token. Keep it to yourself.
import replicate
Run anotherjesse/fastai-bird using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"anotherjesse/fastai-bird:c0126c0fbc1775359a65d6eb7f1ef955610ab995e7f24ed5cbd4f747187948c8",
input={
"image": "https://replicate.delivery/pbxt/JozWvEjU8HJMutd7vXzvdCfhMV9G9mrzNKEyF5bawHYiUld4/bird.jpeg"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_aT6**********************************
This is your API token. Keep it to yourself.
Run anotherjesse/fastai-bird 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/fastai-bird:c0126c0fbc1775359a65d6eb7f1ef955610ab995e7f24ed5cbd4f747187948c8",
"input": {
"image": "https://replicate.delivery/pbxt/JozWvEjU8HJMutd7vXzvdCfhMV9G9mrzNKEyF5bawHYiUld4/bird.jpeg"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
you sent a bird with prob of 0.9999674558639526
{
"id": "qzlwjy3bqilhnw6fmu6cmpeafy",
"model": "anotherjesse/fastai-bird",
"version": "c0126c0fbc1775359a65d6eb7f1ef955610ab995e7f24ed5cbd4f747187948c8",
"input": {
"image": "https://replicate.delivery/pbxt/JozWvEjU8HJMutd7vXzvdCfhMV9G9mrzNKEyF5bawHYiUld4/bird.jpeg"
},
"logs": "/root/.pyenv/versions/3.11.6/lib/python3.11/site-packages/torch/cuda/__init__.py:138: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 11070). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at ../c10/cuda/CUDAFunctions.cpp:108.)\nreturn torch._C._cuda_getDeviceCount() > 0\n/root/.pyenv/versions/3.11.6/lib/python3.11/site-packages/fastai/torch_core.py:263: UserWarning: 'has_mps' is deprecated, please use 'torch.backends.mps.is_built()'\nreturn getattr(torch, 'has_mps', False)\n█\n|----------------------------------------| 0.00% [0/1 00:00<?]\n |████████████████████████████████████████| 100.00% [1/1 00:00<00:00]",
"output": "you sent a bird with prob of 0.9999674558639526",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-11-05T01:55:31.687845Z",
"started_at": "2023-11-05T01:56:15.4735Z",
"completed_at": "2023-11-05T01:56:15.69409Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/qzlwjy3bqilhnw6fmu6cmpeafy/cancel",
"get": "https://api.replicate.com/v1/predictions/qzlwjy3bqilhnw6fmu6cmpeafy"
},
"metrics": {
"predict_time": 0.22059,
"total_time": 44.006245
}
}