Closed sayakpaul closed 1 year ago
cc @sgugger @LysandreJik
Thanks for the report! I can confirm that load_tool
does not properly set the name as described in the tool_config.json
. One workaround is to implement it properly in the class of your tool (setting the name
attribute like you did for the description) but the tool config should probably override the non-defined attribute. Will work on a fix this morning!
Thank you!
For the custom tool, I referred to https://huggingface.co/spaces/huggingface-tools/text-to-image/blob/main/text_to_image.py#L14 and saw it didn't also assign the name
member.
Yes but this one is in the default tools, so is loaded differently. Bug should be fixed soon in any case.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
I have coded an inpainter tool: https://huggingface.co/spaces/sayakpaul/inpainting-tool/
Then I load the tool as follows:
When running
print(f"Description: '{inpainter.description}'")
, it shows the output as expected:Then, I try to add this tool to the list of existing tools:
However, the tool is not added to the toolkit (it just leaves a bullet point):
As a result, when I run:
this is the code that gets generated:
As we can see, there's no mention of the
image_inpainter
here.Anything am I missing out on?
Here's my Colab Notebook for reproduction: https://colab.research.google.com/drive/1BuNz2-7ePeaRaeI7yNc3kqDOzfdXOsUE?usp=sharing
I followed this guide during the process: https://huggingface.co/docs/transformers/custom_tools#using-custom-tools
transformers-cli env
gives: