Skip to main content

A Python library for the Cohere endpoints in AWS Sagemaker

Project description

Cohere Python SDK (AWS SageMaker)

This package provides functionality developed to simplify interfacing with the Cohere models via AWS SageMaker Marketplace in Python 3.

Installation

The package can be installed with pip:

pip install --upgrade cohere-sagemaker

Install from source:

python setup.py install

Quick Start

To use this library, you need to configure your AWS credentials. You can do this by running aws configure. Once that's set up, you can use the library like this:

from cohere_sagemaker import Client

client = Client(endpoint_name='my-cohere-endpoint')

# generate prediction for a prompt
response = client.generate(
    prompt="Tell me a story about",
    max_tokens=20)

print(response.generations[0].text)
# a time when you had to make a difficult decision. What did you do

Note: by default we assume region configured in AWS CLI (aws configure get region), to override use region_name parameter, e.g.

client = Client(endpoint_name='my-cohere-endpoint', region_name='us-east-1')

More detailed examples can be found in the Jupyter notebook.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cohere-sagemaker-0.4.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distributions

cohere_sagemaker-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl (5.8 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

Details for the file cohere-sagemaker-0.4.0.tar.gz.

File metadata

  • Download URL: cohere-sagemaker-0.4.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for cohere-sagemaker-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ba5587e846586c69ccab667a79d5c043fd6a5a5387b98c45ec5f317865d28004
MD5 327ef318945d4d87879c9300b4652c82
BLAKE2b-256 70df425ef207abfe6137bf07a34bd875ec2592ba59db732884869bee543721a4

See more details on using hashes here.

File details

Details for the file cohere_sagemaker-0.4.0-py3.9-macosx-11.1-arm64.egg.

File metadata

File hashes

Hashes for cohere_sagemaker-0.4.0-py3.9-macosx-11.1-arm64.egg
Algorithm Hash digest
SHA256 5e1160c42ac9221bd19cce33fc83645948b0ca93eabf1814c9157b8ef7286674
MD5 d4d77afc208c9e60c582e2c5ea413f3d
BLAKE2b-256 4154eb5a1469107314ca6259486e0bb15ae8b2c25e3b77ea41226e8ce71feed5

See more details on using hashes here.

File details

Details for the file cohere_sagemaker-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for cohere_sagemaker-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 882f0dc425680632ac4ccd80b85b14ca00fa14e8e4095573f47101d5342a8871
MD5 968fbec6d0c92f058a9f38ed448d1ac7
BLAKE2b-256 5ae9e0aad69c0083d0eca745fd790cef48a3f2ef215f914f6cda95accdbe6d57

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page