Skip to content

Commit

Permalink
Remove gradio tools from doc
Browse files Browse the repository at this point in the history
  • Loading branch information
aymeric-roucher committed Dec 31, 2024
1 parent 4c9f04e commit 05772cb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
20 changes: 0 additions & 20 deletions docs/source/en/tutorials/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Here, we're going to see advanced tool usage.
- [What is a tool, and how to build one?](#what-is-a-tool-and-how-to-build-one)
- [Share your tool to the Hub](#share-your-tool-to-the-hub)
- [Import a Space as a tool](#import-a-space-as-a-tool)
- [Use gradio-tools](#use-gradio-tools)
- [Use LangChain tools](#use-langchain-tools)
- [Manage your agent's toolbox](#manage-your-agents-toolbox)
- [Use a collection of tools](#use-a-collection-of-tools)
Expand Down Expand Up @@ -159,25 +158,6 @@ final_answer(image)

How cool is this? 🤩

### Use gradio-tools

[gradio-tools](https://github.com/freddyaboulton/gradio-tools) is a powerful library that allows using Hugging
Face Spaces as tools. It supports many existing Spaces as well as custom Spaces.

Transformers supports `gradio_tools` with the [`Tool.from_gradio`] method. For example, let's use the [`StableDiffusionPromptGeneratorTool`](https://github.com/freddyaboulton/gradio-tools/blob/main/gradio_tools/tools/prompt_generator.py) from `gradio-tools` toolkit for improving prompts to generate better images.

Import and instantiate the tool, then pass it to the `Tool.from_gradio` method:

```python
from gradio_tools import StableDiffusionPromptGeneratorTool

gradio_prompt_generator_tool = StableDiffusionPromptGeneratorTool()
prompt_generator_tool = Tool.from_gradio(gradio_prompt_generator_tool)
```

> [!WARNING]
> gradio-tools require *textual* inputs and outputs even when working with different modalities like image and audio objects. Image and audio inputs and outputs are currently incompatible.
### Use LangChain tools

We love Langchain and think it has a very compelling suite of tools.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ dependencies = [
[project.optional-dependencies]
test = [
"pytest>=8.1.0",
"gradio-tools"
"sqlalchemy"
]

0 comments on commit 05772cb

Please sign in to comment.