The banana package is a python client to interact with your machine learning models hosted on Banana
Project description
Banana Python SDK
Getting Started
Install via pip
pip3 install banana-dev
If integration testing against a local Potassium server:
export BANANA_SERVER=local
to call http://localhost:8000/
directly. Be sure to unset in prod!
If deploying to prod: Sign in / log in here to get your API and Model Keys
Run:
import banana_dev as banana
# Your credentials. Can be empty strings if testing against a local server.
api_key = "demo" # YOUR_API_KEY
model_key = "carrot" # YOUR_MODEL_KEY
model_inputs = {
# a json specific to your model. For example:
"imageURL": "https://demo-images-banana.s3.us-west-1.amazonaws.com/image2.jpg"
}
out = banana.run(api_key, model_key, model_inputs)
print(out)
Return type:
{
"id": "12345678-1234-1234-1234-123456789012",
"message": "success",
"created": 1649712752,
"apiVersion": "26 Nov 2021",
"modelOutputs": [
{
# a json specific to your model. In this example, the caption of the image
"caption": "a baseball player throwing a ball"
}
]
}
Parse the server output:
model_out = out["modelOutputs"][0]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
banana_dev-5.0.1.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for banana_dev-5.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2529c9b5a2d8a763c7c7f5e074a7add97e3686045ee44944b8af40e5c7d1a231 |
|
MD5 | ab79ccaac2bd24de4160ed135aad92e0 |
|
BLAKE2b-256 | f70b9f5cdecaf1d777fd5f7a18578a9d04b1b54cb5f01d32bd7c2bfd7fdc45d6 |