Agents extras (#23301)

* Agents extras

* Add to docs
This commit is contained in:
Lysandre Debut 2023-05-11 20:25:51 +02:00 committed by GitHub
parent ab96bf0294
commit 71b19ee251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 3 deletions

View File

@ -65,7 +65,17 @@ We provide support for openAI models as well as opensource alternatives from Big
models perform better (but require you to have an openAI API key, so cannot be used for free); Hugging Face is models perform better (but require you to have an openAI API key, so cannot be used for free); Hugging Face is
providing free access to endpoints for BigCode and OpenAssistant models. providing free access to endpoints for BigCode and OpenAssistant models.
To use openAI models, you instantiate an [`OpenAiAgent`]: To start with, please install the `agents` extras in order to install all default dependencies.
```bash
pip install transformers[agents]
```
To use openAI models, you instantiate an [`OpenAiAgent`] after installing the `openai` dependency:
```bash
pip install openai
```
```py ```py
from transformers import OpenAiAgent from transformers import OpenAiAgent

View File

@ -112,6 +112,7 @@ _deps = [
"datasets!=2.5.0", "datasets!=2.5.0",
"decord==0.6.0", "decord==0.6.0",
"deepspeed>=0.8.3", "deepspeed>=0.8.3",
"diffusers",
"dill<0.3.5", "dill<0.3.5",
"evaluate>=0.2.0", "evaluate>=0.2.0",
"fairscale>0.3", "fairscale>0.3",
@ -123,7 +124,7 @@ _deps = [
"fugashi>=1.0", "fugashi>=1.0",
"GitPython<3.1.19", "GitPython<3.1.19",
"hf-doc-builder>=0.3.0", "hf-doc-builder>=0.3.0",
"huggingface-hub>=0.11.0,<1.0", "huggingface-hub>=0.14.1,<1.0",
"importlib_metadata", "importlib_metadata",
"ipadic>=1.0.0,<2.0", "ipadic>=1.0.0,<2.0",
"isort>=5.5.4", "isort>=5.5.4",
@ -140,6 +141,7 @@ _deps = [
"onnxconverter-common", "onnxconverter-common",
"onnxruntime-tools>=1.4.2", "onnxruntime-tools>=1.4.2",
"onnxruntime>=1.4.0", "onnxruntime>=1.4.0",
"opencv-python",
"optuna", "optuna",
"optax>=0.0.8,<=0.1.4", "optax>=0.0.8,<=0.1.4",
"packaging>=20.0", "packaging>=20.0",
@ -412,6 +414,16 @@ extras["torchhub"] = deps_list(
"tqdm", "tqdm",
) )
extras["agents"] = deps_list(
"diffusers",
"accelerate",
"datasets",
"torch",
"sentencepiece",
"opencv-python",
"Pillow"
)
# when modifying the following list, make sure to update src/transformers/dependency_versions_check.py # when modifying the following list, make sure to update src/transformers/dependency_versions_check.py
install_requires = [ install_requires = [
deps["importlib_metadata"] + ";python_version<'3.8'", # importlib_metadata for Python versions that don't have it deps["importlib_metadata"] + ";python_version<'3.8'", # importlib_metadata for Python versions that don't have it

View File

@ -13,6 +13,7 @@ deps = {
"datasets": "datasets!=2.5.0", "datasets": "datasets!=2.5.0",
"decord": "decord==0.6.0", "decord": "decord==0.6.0",
"deepspeed": "deepspeed>=0.8.3", "deepspeed": "deepspeed>=0.8.3",
"diffusers": "diffusers",
"dill": "dill<0.3.5", "dill": "dill<0.3.5",
"evaluate": "evaluate>=0.2.0", "evaluate": "evaluate>=0.2.0",
"fairscale": "fairscale>0.3", "fairscale": "fairscale>0.3",
@ -24,7 +25,7 @@ deps = {
"fugashi": "fugashi>=1.0", "fugashi": "fugashi>=1.0",
"GitPython": "GitPython<3.1.19", "GitPython": "GitPython<3.1.19",
"hf-doc-builder": "hf-doc-builder>=0.3.0", "hf-doc-builder": "hf-doc-builder>=0.3.0",
"huggingface-hub": "huggingface-hub>=0.11.0,<1.0", "huggingface-hub": "huggingface-hub>=0.14.1,<1.0",
"importlib_metadata": "importlib_metadata", "importlib_metadata": "importlib_metadata",
"ipadic": "ipadic>=1.0.0,<2.0", "ipadic": "ipadic>=1.0.0,<2.0",
"isort": "isort>=5.5.4", "isort": "isort>=5.5.4",
@ -41,6 +42,7 @@ deps = {
"onnxconverter-common": "onnxconverter-common", "onnxconverter-common": "onnxconverter-common",
"onnxruntime-tools": "onnxruntime-tools>=1.4.2", "onnxruntime-tools": "onnxruntime-tools>=1.4.2",
"onnxruntime": "onnxruntime>=1.4.0", "onnxruntime": "onnxruntime>=1.4.0",
"opencv-python": "opencv-python",
"optuna": "optuna", "optuna": "optuna",
"optax": "optax>=0.0.8,<=0.1.4", "optax": "optax>=0.0.8,<=0.1.4",
"packaging": "packaging>=20.0", "packaging": "packaging>=20.0",