معرفی شرکت ها


fetch-embed-0.1.6


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

-
ویژگی مقدار
سیستم عامل -
نام فایل fetch-embed-0.1.6
نام fetch-embed
نسخه کتابخانه 0.1.6
نگهدارنده []
ایمیل نگهدارنده []
نویسنده freemt
ایمیل نویسنده -
آدرس صفحه اصلی https://github.com/ffreemt/fetch-embed
آدرس اینترنتی https://pypi.org/project/fetch-embed/
مجوز MIT
# fetch-embed <!--- fetch-embed fetch_embed fetch_embed fetch_embed ---> [![tests](https://github.com/ffreemt/fetch-embed/actions/workflows/routine-tests.yml/badge.svg)][![python](https://img.shields.io/static/v1?label=python+&message=3.7%2B&color=blue)](https://img.shields.io/static/v1?label=python+&message=3.7%2B&color=blue)[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)[![PyPI version](https://badge.fury.io/py/fetch_embed.svg)](https://badge.fury.io/py/fetch_embed) fetch multilingual embed from embed.ttw.workers.dev ## Install it ```bash pip install -U fetch-embed ``` ## Use it ### Make use of the helper function `embed_text` #### `endpoints` for two models (dim-52 and dim-768) via cloudflare: `https://embed.ttw.workers.dev/embed/` and `https://embed.ttw.workers.dev/embed_la/` In case you cannot access `embed.ttw.workers.dev`, you may use `ttw.hopto.org` (hosted by noip.com) instead. ##### Swagger UI: Self-docs for these endpoints [https://embed.ttw.workers.dev/docs](https://embed.ttw.workers.dev/docs) [https://ttw.hopto.org/docs](https://ttw.hopto.org/docs) #### Model 1: multilingual, dim-512 The default endpoint is `https://embed.ttw.workers.dev/embed/` ```python from fetch_embed.embed_text import embed_text res = embed_text(["test a", "测试"]) print(res.shape) # (2, 512) ``` #### Model 2: language agnostic, dim-768 endpoint: `https://embed.ttw.workers.dev/embed_la/` ```python from fetch_embed.embed_text import embed_text endpoint = "https://embed.ttw.workers.dev/embed_la/" res = embed_text(["test a", "测试"], endpoint=endpoint) print(res.shape) # (2, 768) ``` Consult the `embed_text.__doc__` (e.g. `print(embed_text.__doc__)`) or its source code for more details. ### Access the API directly ```python from fetch_embed import fetch_embed res = fetch_embed("test me") print(res.shape) # (1, 512) print(fetch_embed(["test me", "测试123"]).shape # (2, 512) # to turn off live progress bar res = fetch_embed("test me", livepbar=False) # brief docs help(fetch_embed) # fetch_embed(texts:Union[str, List[str]], endpoint:str='http://ttw.hopto.org/embed/', livepbar:bool=True) -> numpy.ndarray Fetch embed from endpoint. ``` Plug in `endpoint = "https://embed.ttw.workers.dev/embed_la/"` for Model 2, e.g., ```python import numpy as np from fetch_embed import fetch_embed endpoint = "https://embed.ttw.workers.dev/embed_la/" res = fetch_embed("test me", endpoint=endpoint) print(np.array(res).shape) # (1, 768) ```


نیازمندی

مقدار نام
>=0.17.1,<0.18.0 httpx
>=1.6.2,<2.0.0 alive-progress
>=1.7.0,<2.0.0 logzero
>=1.20.2,<2.0.0 numpy
>=0.5.3,<0.6.0 loguru
>=1.0.1,<2.0.0 joblib
>=4.60.0,<5.0.0 tqdm


زبان مورد نیاز

مقدار نام
>=3.7,<4.0 Python


نحوه نصب


نصب پکیج whl fetch-embed-0.1.6:

    pip install fetch-embed-0.1.6.whl


نصب پکیج tar.gz fetch-embed-0.1.6:

    pip install fetch-embed-0.1.6.tar.gz