Name | aiconfig-extension-hugging-face JSON |
Version |
0.0.13
JSON |
| download |
home_page | |
Summary | An extension for using Hugging Face tasks to parse models for AIConfig. |
upload_time | 2024-02-14 21:41:44 |
maintainer | |
docs_url | None |
author | LastMile AI |
requires_python | >=3.10 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
This extension contains AIConfig model parsers with two main subfolders:
1. `local_inference`: Loads models onto your machine and uses Hugging Face transformers and diffusors locally.
2. `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
1. From the `aiconfig/extensions/HuggingFace`, run this command: `pip3 install build && cd python && python -m build && pip3 install dist/*.whl`
2. Link your local dev environment to the current dir: `pip3 install -e .`. Afterwards if you do `pip3 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`
3. After you're done testing, be sure to delete the generated folder(s) in the `aiconfig/HuggingFace` dir. It'll probably look something like `python/dist` and `python/<package_name>.egg-info`
### Part 2: Importing and using this extension
``pip3 install aiconfig-extension-hugging-face``
1. Import the library to your code: `from aiconfig_extension_hugging_face import <EXTENSION>`.
2. Import the AIConfig model registery: `from aiconfig import ModelRegistryParser`
3. 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 under `ModelParserRegistry` class for more info
4. In your AIConfig, add a field `model_parsers` with 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
5. Now whenever you call `aiconfig.run()` these model parsers will be loaded and available!
Raw data
{
"_id": null,
"home_page": "",
"name": "aiconfig-extension-hugging-face",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "",
"author": "LastMile AI",
"author_email": "Rossdan Craig <rossdan@lastmileai.dev>, Ankush Pala <ankush@lastmileai.dev>",
"download_url": "https://files.pythonhosted.org/packages/e5/f7/2e05fb8ddf44fbbc083da74888596d14684ab5abc3607a331892b1be6966/aiconfig_extension_hugging_face-0.0.13.tar.gz",
"platform": null,
"description": "This extension contains AIConfig model parsers with two main subfolders:\n\n1. `local_inference`: Loads models onto your machine and uses Hugging Face transformers and diffusors locally.\n2. `remote_inference_client`: Uses Hugging Face's InferenceClient API to connect to models remotely\n\n## Usage\n\n### Part 1: Update and test this extension\n\nIf you are not testing and developing locally (just using the published extension), ignore this and go to Part 2\n\n1. From the `aiconfig/extensions/HuggingFace`, run this command: `pip3 install build && cd python && python -m build && pip3 install dist/*.whl`\n2. Link your local dev environment to the current dir: `pip3 install -e .`. Afterwards if you do `pip3 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`\n3. After you're done testing, be sure to delete the generated folder(s) in the `aiconfig/HuggingFace` dir. It'll probably look something like `python/dist` and `python/<package_name>.egg-info`\n\n### Part 2: Importing and using this extension\n\n``pip3 install aiconfig-extension-hugging-face``\n\n1. Import the library to your code: `from aiconfig_extension_hugging_face import <EXTENSION>`.\n2. Import the AIConfig model registery: `from aiconfig import ModelRegistryParser`\n3. 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 under `ModelParserRegistry` class for more info\n4. In your AIConfig, add a field `model_parsers` with 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\n5. Now whenever you call `aiconfig.run()` these model parsers will be loaded and available!\n",
"bugtrack_url": null,
"license": "",
"summary": "An extension for using Hugging Face tasks to parse models for AIConfig.",
"version": "0.0.13",
"project_urls": {
"Homepage": "https://github.com/lastmile-ai/aiconfig/",
"Issues": "https://github.com/lastmile-ai/aiconfig/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "901acfdd951dc4f691d6f320eed41f3975fd5eabe52d9f460da3559ca9219326",
"md5": "b7b85c39478294c7566a45e26a8d5cf4",
"sha256": "c5acb889f2b0b65a95a8464d548e324e4b6c3216ee535d9447be79d2e7c7e414"
},
"downloads": -1,
"filename": "aiconfig_extension_hugging_face-0.0.13-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b7b85c39478294c7566a45e26a8d5cf4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 57177,
"upload_time": "2024-02-14T21:41:43",
"upload_time_iso_8601": "2024-02-14T21:41:43.027823Z",
"url": "https://files.pythonhosted.org/packages/90/1a/cfdd951dc4f691d6f320eed41f3975fd5eabe52d9f460da3559ca9219326/aiconfig_extension_hugging_face-0.0.13-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e5f72e05fb8ddf44fbbc083da74888596d14684ab5abc3607a331892b1be6966",
"md5": "571421251baff27be78cde549f7c0083",
"sha256": "63bce1436683b28276885a52a51989c6219872287f1bdc16bcfc227c69e6bf9f"
},
"downloads": -1,
"filename": "aiconfig_extension_hugging_face-0.0.13.tar.gz",
"has_sig": false,
"md5_digest": "571421251baff27be78cde549f7c0083",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 24374,
"upload_time": "2024-02-14T21:41:44",
"upload_time_iso_8601": "2024-02-14T21:41:44.599470Z",
"url": "https://files.pythonhosted.org/packages/e5/f7/2e05fb8ddf44fbbc083da74888596d14684ab5abc3607a331892b1be6966/aiconfig_extension_hugging_face-0.0.13.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-14 21:41:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lastmile-ai",
"github_project": "aiconfig",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aiconfig-extension-hugging-face"
}