Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
71b19ee2
Unverified
Commit
71b19ee2
authored
May 11, 2023
by
Lysandre Debut
Committed by
GitHub
May 11, 2023
Browse files
Agents extras (#23301)
* Agents extras * Add to docs
parent
ab96bf02
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
docs/source/en/transformers_agents.mdx
docs/source/en/transformers_agents.mdx
+11
-1
setup.py
setup.py
+13
-1
src/transformers/dependency_versions_table.py
src/transformers/dependency_versions_table.py
+3
-1
No files found.
docs/source/en/transformers_agents.mdx
View file @
71b19ee2
...
@@ -65,7 +65,17 @@ We provide support for openAI models as well as opensource alternatives from Big
...
@@ -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
...
...
setup.py
View file @
71b19ee2
...
@@ -112,6 +112,7 @@ _deps = [
...
@@ -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 = [
...
@@ -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.1
1.0
,<1.0"
,
"huggingface-hub>=0.1
4.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 = [
...
@@ -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(
...
@@ -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
...
...
src/transformers/dependency_versions_table.py
View file @
71b19ee2
...
@@ -13,6 +13,7 @@ deps = {
...
@@ -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 = {
...
@@ -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.1
1.0
,<1.0"
,
"huggingface-hub"
:
"huggingface-hub>=0.1
4.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 = {
...
@@ -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"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment