"Implementation of [HuggingGPT](https://github.com/microsoft/JARVIS). HuggingGPT is a system to connect LLMs (ChatGPT) with ML community (Hugging Face).\n",
"We set up the tools available from [Transformers Agent](https://huggingface.co/docs/transformers/transformers_agents#tools). It includes a library of tools supported by Transformers and some customized tools such as image generator, video generator, text downloader and other tools."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from transformers import load_tool"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"hf_tools = [\n",
" load_tool(tool_name)\n",
" for tool_name in [\n",
" \"document-question-answering\",\n",
" \"image-captioning\",\n",
" \"image-question-answering\",\n",
" \"image-segmentation\",\n",
" \"speech-to-text\",\n",
" \"summarization\",\n",
" \"text-classification\",\n",
" \"text-question-answering\",\n",
" \"translation\",\n",
" \"huggingface-tools/text-to-image\",\n",
" \"huggingface-tools/text-to-video\",\n",
" \"text-to-speech\",\n",
" \"huggingface-tools/text-download\",\n",
" \"huggingface-tools/image-transformation\",\n",
" ]\n",
"]"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup model and HuggingGPT\n",
"\n",
"We create an instance of HuggingGPT and use ChatGPT as the controller to rule the above tools."