Skip to content

Commit

Permalink
Minor client changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlucy-stripe committed Oct 31, 2018
1 parent ac427e0 commit 05a8122
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions basilica/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Supported Python versions: 2.7

Releases
========
- 0.2.4 : 10-28-2018
- Changed default batch size, added `six` dependency.
- 0.2.3 : 10-28-2018
- Implemented client retries.
- 0.2.2 : 10-15-2018
Expand Down
12 changes: 6 additions & 6 deletions basilica/basilica/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def embed(self, url, data, batch_size, opts, timeout):
batch = []

def embed_images(self, images, model='generic', version='default',
batch_size=64, opts={}, timeout=30):
"""Generate embeddings for images. Images should be passed as byte strings, and will be sent to the server in batches to be embedded.
batch_size=32, opts={}, timeout=30):
"""Generate embeddings for JPEG images. Images should be passed as byte strings, and will be sent to the server in batches to be embedded.
:param images: An iterable (such as a list) of the images to embed.
:type images: Iterable[str]
Expand Down Expand Up @@ -122,7 +122,7 @@ def embed_images(self, images, model='generic', version='default',

def embed_image(self, image, model='generic', version='default',
opts={}, timeout=10):
"""Generate the embedding for an image. The image should be passed as a byte string.
"""Generate the embedding for a JPEG image. The image should be passed as a byte string.
:param image: The image to embed.
:type image: str
Expand All @@ -146,8 +146,8 @@ def embed_image(self, image, model='generic', version='default',
opts=opts, timeout=timeout))[0]

def embed_image_files(self, image_files, model='generic', version='default',
batch_size=64, opts={}, timeout=30):
"""Generate embeddings for image files. The file names should be passed as paths that can be understood by `open`.
batch_size=32, opts={}, timeout=30):
"""Generate embeddings for JPEG image files. The file names should be passed as paths that can be understood by `open`.
:param image_files: An iterable (such as a list) of paths to the images to embed.
:type image_files: Iterable[str]
Expand Down Expand Up @@ -179,7 +179,7 @@ def load_image_files(image_files):

def embed_image_file(self, image_file, model='generic', version='default',
opts={}, timeout=10):
"""Generate the embedding for an image file. The file name should be passed as a path that can be understood by `open`.
"""Generate the embedding for a JPEG image file. The file name should be passed as a path that can be understood by `open`.
:param image_file: Path to the image to embed.
:type image_file: str
Expand Down
3 changes: 2 additions & 1 deletion basilica/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup

setup(name='basilica',
version='0.2.3',
version='0.2.4',
description='Client bindings for basilica.ai embeddings.',
long_description='Client bindings for basilica.ai embeddings.',
url='http://basilica.ai',
Expand All @@ -11,5 +11,6 @@
packages=['basilica'],
install_requires=[
'requests',
'six',
],
zip_safe=True)

0 comments on commit 05a8122

Please sign in to comment.