This extension contains AIConfig model parsers with two main subfolders:
local_inference: Loads models onto your machine and uses Hugging Face transformers and diffusors locally.remote_inference_client: Uses Hugging Face's InferenceClient API to connect to models remotely
Usage
Part 1: Update and test this extension
If you are not testing and developing locally (just using the published extension), ignore this and go to Part 2
- From the
aiconfig/extensions/HuggingFace, run this command:pip3 install build && cd python && python -m build && pip3 install dist/*.whl - Link your local dev environment to the current dir:
pip3 install -e .. Afterwards if you dopip3 list | grep aiconfig, you should see this linked to your local path. If you ever wish to use the published extension, you will need to first remove the extension:pip3 uninstall aiconfig-extension-hugging-face && pip3 install aiconfig-extension-hugging-face - After you're done testing, be sure to delete the generated folder(s) in the
aiconfig/HuggingFacedir. It'll probably look something likepython/distandpython/<package_name>.egg-info
Part 2: Importing and using this extension
pip3 install aiconfig-extension-hugging-face
- Import the library to your code:
from aiconfig_extension_hugging_face import <EXTENSION>. - Import the AIConfig model registery:
from aiconfig import ModelRegistryParser - In code, add all the relevant model parser objects that you want to use from this extension to the registry. Ex:
ModelParserRegistry.register_model_parser(HuggingFaceTextGenerationTransformer()). You can read the docstrings underModelParserRegistryclass for more info - In your AIConfig, add a field
model_parserswith the model you want to use and the id of the extension you want to use: . Ex: https://github.com/lastmile-ai/aiconfig/blob/f1840995b7a12acba371a59ac3b8c69b3962fc68/cookbooks/Getting-Started/travel.aiconfig.json#L19-L22 - Now whenever you call
aiconfig.run()these model parsers will be loaded and available!
Release files for aiconfig-extension-hugging-face 0.0.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aiconfig_extension_hugging_face-0.0.13.tar.gz | 24.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aiconfig_extension_hugging_face-0.0.13-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 81.6 kB
Release files / aiconfig_extension_hugging_face-0.0.13.tar.gz
| Download URL | aiconfig_extension_hugging_face-0.0.13.tar.gz |
|---|---|
| Size | 24.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63bce1436683b28276885a52a51989c6219872287f1bdc16bcfc227c69e6bf9f
|
|
BLAKE2b-256 checksum How to use checksums |
e5f72e05fb8ddf44fbbc083da74888596d14684ab5abc3607a331892b1be6966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / aiconfig_extension_hugging_face-0.0.13-py3-none-any.whl
| Download URL | aiconfig_extension_hugging_face-0.0.13-py3-none-any.whl |
|---|---|
| Size | 57.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5acb889f2b0b65a95a8464d548e324e4b6c3216ee535d9447be79d2e7c7e414
|
|
BLAKE2b-256 checksum How to use checksums |
901acfdd951dc4f691d6f320eed41f3975fd5eabe52d9f460da3559ca9219326
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|