Skip to main content

Encoders

A library of neural encoders to convert any types of data into embeddings, dense or sparse.

Build a package

python setup.py bdist_wheel
twine upload dist/*

Use Locally

model = EncoderLoader.load_model('pretrain-models', <model_id>, use_gpu=True, region='cn')
model.encode(['I am a good man'], show_progress_bar=True, batch_size=batch_size,)

Use as RESTful API

Start a server

uvicorn soco_encoders.http.main:app --host 0.0.0.0 --port 8000 --workers 4

Start a client

res = requests.post(url='http://localhost:8000/encoder/v1/encode',
                      json={
                          "model_id": model_id,
                          "text": [x1] * batch_size,
                          'batch_size': batch_size,
                          "mode": "default",
                          "kwargs": {}
                      })

Use as GRPC API

Start a server

python -m soco_encoders.grpc.server --host 0.0.0.0 --port 8000 --workers 4

Start a client

   check out example in bench_grpc.py

Download files

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

Source Distribution

soco-encoders-0.2.9.2.tar.gz (33.3 kB view details)

Uploaded Source

File details

Details for the file soco-encoders-0.2.9.2.tar.gz.

File metadata

  • Download URL: soco-encoders-0.2.9.2.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.2

File hashes

Hashes for soco-encoders-0.2.9.2.tar.gz
Algorithm Hash digest
SHA256 29097f0d2f740116026f420da2270d4b2a9ce3835ac1a3ada56fa95d3f054e76
MD5 0aed0504ad8ad32e098db0504567120d
BLAKE2b-256 d19cc90fba422d9b7a6ed881ec70eea113aa96b2a7179fea3d3ca80e531039d0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.9.2 This release

1 file

0.2.9.1

1 file

0.2.9

1 file

0.2.8

1 file

0.2.7

1 file

0.2.6

1 file

0.2.5

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

2 files

0.2.1

1 file

0.2

1 file

0.1.9.4

1 file

0.1.9.3

1 file

0.1.9.2

1 file

0.1.9.1

2 files

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6.2

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page