semvec/pypi-packages huggingface dataset:
clickhouse-sqlalchemy 0.1.12
Simple ClickHouse SQLAlchemy Dialect
License: MIT
Requires Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,<4,>=2.7
Keywords: ClickHouse db database cloud analytics

ClickHouse SQLAlchemy
=====================

ClickHouse dialect for SQLAlchemy to `ClickHouse database <https://clickhouse.yandex/>`_.


.. image:: https://img.shields.io/pypi/v/clickhouse-sqlalchemy.svg
    :target: https://pypi.org/project/clickhouse-sqlalchemy

.. image:: https://coveralls.io/repos/github/xzkostyan/clickhouse-sqlalchemy/badge.svg?branch=master
    :target: https://coveralls.io/github/xzkostyan/clickhouse-sqlalchemy?branch=master

.. image:: https://img.shields.io/pypi/l/clickhouse-sqlalchemy.svg
    :target: https://pypi.org/project/clickhouse-sqlalchemy

.. image:: https://img.shields.io/pypi/pyversions/clickhouse-sqlalchemy.svg
    :target: https://pypi.org/project/clickhouse-sqlalchemy

.. image:: https://img.shields.io/pypi/dm/clickhouse-sqlalchemy.svg
    :target: https://pypi.org/project/clickhouse-sqlalchemy

.. image:: https://github.com/xzkostyan/clickhouse-sqlalchemy/actions/workflows/actions.yml/badge.svg
   :target: https://github.com/xzkostyan/clickhouse-sqlalchemy/actions/workflows/actions.yml


Documentation
=============

Documentation is available at https://clickhouse-sqlalchemy.readthedocs.io.


Usage
=====

Supported interfaces:

- **native** [recommended] (TCP) via `clickhouse-driver <https://github.com/mymarilyn/clickhouse-driver>`_
- **http** via requests

Define table

    .. code-block:: python

        from sqlalchemy import create_engine, Column, MetaData

        from clickhouse_sqlalchemy import (
            Table, make_session, get_declarative_base, types, engines
        )

        uri = 'clickhouse+native://localhost/default'

        engine = create_engine(uri)
        session = make_session(engine)
        metadata = MetaData(bind=engine)

        Base = get_declarative_base(metadata=metadata)

        class Rate(Base):
            day = Column(types.Date, primary_key=True)
            value = Column(types.Int32)

            __table_args__ = (
                engines.Memory(),
            )

        Rate.__table__.create()


Insert some data

    .. code-block:: python

        from datetime import date, timedelta

        from sqlalchemy import func

        today = date.today()
        rates = [
            {'day': today - timedelta(i), 'value': 200 - i}
            for i in range(100)
        ]


And query inserted data

    .. code-block:: python

        session.execute(Rate.__table__.insert(), rates)

        session.query(func.count(Rate.day)) \
            .filter(Rate.day > today - timedelta(20)) \
            .scalar()


License
=======

ClickHouse SQLAlchemy is distributed under the `MIT license
<http://www.opensource.org/licenses/mit-license.php>`_.
untool 0.2.2
Union Tool for inference on Sophgo chips
License: MIT
Requires Python: >=3.8

# UnTool

UnTool是一个用于Sophon芯片推理的Python工具包，支持x86_64和aarch64架构，以及SOC和PCIE两种模式。

## 安装

```bash
pip install untool
```

## 使用示例

**接口使用**：

- 接口1：适用于LLM或多模态LLM，`untool.LLMBasePipeline`封装，便于修改

```python
import argparse
from untool import LLMBasePipeline, MiniCPMVPipeline

parser = argparse.ArgumentParser()
parser.add_argument('-m', '--model_path', type=str, required=True, help='bmodel文件路径')
parser.add_argument('-t', '--tokenizer_path', type=str, required=True, help='tokenizer文件路径')
parser.add_argument('-d', '--devid', type=int, default=0, help='设备ID')
args = parser.parse_args()

pipeline = LLMBasePipeline(args)  # 常规LLM，如Qwen2.5
# pipeline = MiniCPMVPipeline(args)  # 多模态LLM，如MiniCPMV2.6
pipeline.chat()
```

- 接口2：适用于LLM，C++底层封装，推理速度更快，但不便修改

```python
import argparse
from untool import EngineLLM

parser = argparse.ArgumentParser()
parser.add_argument('-m', '--model_path', type=str, required=True, help='bmodel文件路径')
parser.add_argument('-t', '--tokenizer_path', type=str, required=True, help='tokenizer文件路径')
parser.add_argument('-d', '--devid', type=int, default=0, help='设备ID')
args = parser.parse_args()

engine = EngineLLM(args)
engine.chat()
```

- 接口3：适用于CV模型等

```python
from untool import EngineOV

model = EngineOV("path/to/model.bmodel", device_id=0)
result = model([input_np_array])[0]
```

`EngineOV`接口可以通过`self.reset_net_stage(net_idx, stage_idx)`切换不同的net和stage。

**基于untool开发的项目参考**：[LLM分布式推理](https://www.modelscope.cn/models/wlc952/TwinStream-LLM)、[AIGC-SDK](https://www.modelscope.cn/models/wlc952/AIGC-SDK)。

## 其他

详见源代码仓库`https://www.modelscope.cn/wlc952/UnTool.git`