Skip to main content

AI Handler: An engine which wraps certain huggingface models

Project description

AI Handler

Upload Python Package Discord GitHub GitHub last commit GitHub issues GitHub closed issues GitHub pull requests GitHub closed pull requests

This is a simple framework for running AI models. It makes use of the huggingface API which gives you a queue, threading, a simple API, and the ability to run Stable Diffusion and LLMs seamlessly from your local hardware.

This is not intended to be used as a standalone application.

It can easily be extended and used to power interfaces or it can be run from the command line.

AI Handler is a work in progress. It powers two projects at the moment, but may not be ready for general use.

Installation

This is a work in progress.

Pre-requisites

System requirements

  • Windows 10+
  • Python 3.10.8
  • pip 23.0.1
  • CUDA toolkit 11.7
  • CUDNN 8.6.0.163
  • Cuda capable GPU
  • 16gb+ ram

For Windows, follow windows branch instructions

Install

pip install https://github.com/w4ffl35/diffusers/archive/refs/tags/v0.15.0.ckpt_fix_0.0.1.tar.gz
pip install aihandler

Optional

These are optional instructions for installing TensorRT and Deepspeed for Windows

Install Tensor RT:
  1. Download TensorRT-8.4.3.1.Windows10.x86_64.cuda-11.6.cudnn8.4
  2. Git clone TensorRT 8.4.3.1
  3. Follow their instructions to build TensorRT-8.4.3.1 python wheel
  4. Install TensorRT pip install tensorrt-*.whl
Install Deepspeed:
  1. Git clone Deepspeed 0.8.1
  2. Follow their instructions to build Deepspeed python wheel
  3. Install Deepspeed `pip install deepspeed-*.whl

Environment variables

  • AIRUNNER_ENVIRONMENT - dev or prod. Defaults to dev. This controls the LOG_LEVEL
  • LOG_LEVEL - FATAL for production, DEBUG for development. Override this to force a log level

Huggingface variables

Offline mode

These environment variables keep you offline until you need to download a model. This prevents unwanted online access and speeds up usage of huggingface libraries.

  • DISABLE_TELEMETRY Keep this set to 1 at all times. Huggingface collects minimal telemetry when downloading a model from their repository but this will keep it disabled. See more info in this github thread
  • HF_HUB_OFFLINE When loading a diffusers model, huggingface libraries will attempt to download an updated cache before running the model. This prevents that check from happening (long with a boolean passed to load_pretrained see the runner.py file for examples)
  • TRANSFORMERS_OFFLINE Similar to HF_HUB_OFFLINE but for transformers models

Project details


Download files

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

Source Distribution

aihandler-1.14.6.tar.gz (49.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aihandler-1.14.6-py3-none-any.whl (52.2 kB view details)

Uploaded Python 3

File details

Details for the file aihandler-1.14.6.tar.gz.

File metadata

  • Download URL: aihandler-1.14.6.tar.gz
  • Upload date:
  • Size: 49.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for aihandler-1.14.6.tar.gz
Algorithm Hash digest
SHA256 8c95912bfcb81201e1f2819408a235987c66732fd0216408cc44b2394e917bc9
MD5 16f09fa05002b0d91b89af1f512662c5
BLAKE2b-256 3177e8f29168c05cd29cc77d931efe18ec7a9c327193462ad493ae99f5be44f3

See more details on using hashes here.

File details

Details for the file aihandler-1.14.6-py3-none-any.whl.

File metadata

  • Download URL: aihandler-1.14.6-py3-none-any.whl
  • Upload date:
  • Size: 52.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for aihandler-1.14.6-py3-none-any.whl
Algorithm Hash digest
SHA256 843d19ace0afe73e675e45da7fad1300dbb3d0dc8fa023378162839d960b069c
MD5 42101b3a63e71711b472af3fe23b1b22
BLAKE2b-256 8e4e18f5291d23bd2aa9c83b3980f34a808d4550a247bc152abb56b5e74ad408

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page