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

Metadata

Release files for soco-encoders 0.2.9.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for soco-encoders 0.2.9.2
File Size Uploaded Provenance
soco-encoders-0.2.9.2.tar.gz 33.3 kB Without provenance Details

Release files / soco-encoders-0.2.9.2.tar.gz

Download URL soco-encoders-0.2.9.2.tar.gz
Size 33.3 kB
Tags Source
SHA-256 checksum
How to use checksums
29097f0d2f740116026f420da2270d4b2a9ce3835ac1a3ada56fa95d3f054e76
BLAKE2b-256 checksum
How to use checksums
d19cc90fba422d9b7a6ed881ec70eea113aa96b2a7179fea3d3ca80e531039d0
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for soco-encoders 0.2.9.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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