Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
OurBuilding Ambient Agents with LangGraph course is now available on LangChain Academy!
Open In ColabOpen on GitHub

HuggingFace Hub Tools

Huggingface Tools that supporting text I/O can beloaded directly using theload_huggingface_tool function.

# Requires transformers>=4.29.0 and huggingface_hub>=0.14.1
%pip install--upgrade--quiet transformers huggingface_hub>/dev/null
%pip install--upgrade--quiet  langchain-community
from langchain_community.agent_toolkits.load_toolsimport load_huggingface_tool

tool= load_huggingface_tool("lysandre/hf-model-downloads")

print(f"{tool.name}:{tool.description}")
API Reference:load_huggingface_tool
model_download_counter: This is a tool that returns the most downloaded model of a given task on the Hugging Face Hub. It takes the name of the category (such as text-classification, depth-estimation, etc), and returns the name of the checkpoint
tool.run("text-classification")
'facebook/bart-large-mnli'

Related


[8]ページ先頭

©2009-2025 Movatter.jp