We first import the tool from gradio_tools and instantiate it: | |
thon | |
from gradio_tools import StableDiffusionPromptGeneratorTool | |
gradio_tool = StableDiffusionPromptGeneratorTool() | |
We pass that instance to the Tool.from_gradio method: | |
thon | |
from transformers import Tool | |
tool = Tool.from_gradio(gradio_tool) | |
Now we can manage it exactly as we would a usual custom tool. |