semvec/pypi-packages huggingface dataset:
py-tgi 0.2.0
A Python wrapper around TGI and TEI servers
Keywords: tgi,llm,tei,embedding,huggingface,docker,python

# Py-TGI (Py-TXI at this point xD)

[![PyPI version](https://badge.fury.io/py/py-tgi.svg)](https://badge.fury.io/py/py-tgi)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/py-tgi)](https://pypi.org/project/py-tgi/)
[![PyPI - Format](https://img.shields.io/pypi/format/py-tgi)](https://pypi.org/project/py-tgi/)
[![Downloads](https://pepy.tech/badge/py-tgi)](https://pepy.tech/project/py-tgi)
[![PyPI - License](https://img.shields.io/pypi/l/py-tgi)](https://pypi.org/project/py-tgi/)
[![Tests](https://github.com/IlyasMoutawwakil/py-tgi/actions/workflows/tests.yaml/badge.svg)](https://github.com/IlyasMoutawwakil/py-tgi/actions/workflows/tests.yaml)

Py-TGI is a Python wrapper around [Text-Generation-Inference](https://github.com/huggingface/text-generation-inference) and [Text-Embedding-Inference](https://github.com/huggingface/text-embeddings-inference) that enables creating and running TGI/TEI instances through the awesome `docker-py` in a similar style to Transformers API.

## Installation

```bash
pip install py-tgi
```

Py-TGI is designed to be used in a similar way to Transformers API. We use `docker-py` (instead of a dirty `subprocess` solution) so that the containers you run are linked to the main process and are stopped automatically when your code finishes or fails.

## Usage

Here's an example of how to use it:

```python
from py_tgi import TGI, is_nvidia_system, is_rocm_system

llm = TGI(
    model="NousResearch/Llama-2-7b-hf",
    devices=["/dev/kfd", "/dev/dri"] if is_rocm_system() else None,
    gpus="all" if is_nvidia_system() else None,
)
output = llm.generate(["Hi, I'm a language model", "I'm fine, how are you?"])
print(output)
```

Output: ```[" and I'm here to help you with any questions you have. What can I help you with", "\nUser 0: I'm doing well, thanks for asking. I'm just a"]```

```python
from py_tgi import TEI, is_nvidia_system

embed = TEI(
    model="BAAI/bge-large-en-v1.5",
    dtype="float16",
    pooling="mean",
    gpus="all" if is_nvidia_system() else None,
)
output = embed.encode(["Hi, I'm an embedding model", "I'm fine, how are you?"])
print(output)
```

Output: ```[array([[ 0.01058742, -0.01588806, -0.03487622, ..., -0.01613717,
         0.01772875, -0.02237891]], dtype=float32), array([[ 0.02815401, -0.02892136, -0.0536355 , ...,  0.01225784,
        -0.00241452, -0.02836569]], dtype=float32)]```

That's it! Now you can write your Python scripts using the power of TGI and TEI without having to worry about the underlying Docker containers.
heavyai 1.3
Data science toolkit support for HeavyDB
Requires Python: >=3.7

[![PyPi package link](https://img.shields.io/pypi/v/heavyai?style=for-the-badge)](https://pypi.org/project/heavyai/)
[![Conda package link](https://img.shields.io/conda/vn/conda-forge/heavyai?style=for-the-badge)](https://anaconda.org/conda-forge/heavyai)


heavyai
=======

This package enables using common Python data science toolkits with
[HeavyDB](http://heavy.ai).
It brings data frame support on CPU and GPU as well as support for arrow.
See the [documentation](http://heavyai.readthedocs.io/en/latest/?badge=latest)
for more.

Quick Install (CPU)
-------------------

Packages are available on conda-forge and PyPI:

```bash
# using conda-forge
conda install -c conda-forge heavyai

# using pip
pip install heavyai
```

Quick Install (GPU)
-------------------

We recommend creating a fresh conda 3.8 or 3.9 environment when installing
heavyai with GPU capabilities.

To install heavyai for GPU Dataframe support (conda-only):

```bash
mamba create -n heavyai-gpu -c rapidsai -c nvidia -c conda-forge -c defaults \
    --no-channel-priority \
    cudf heavyai pyheavydb pytest shapely geopandas pyarrow=*=*cuda
```

Documentation
-------------

Further documentation for heavyai usage is available at: http://heavyai.readthedocs.io/