Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
本站翻译于2026年5月3日,请放心食用🎉🎉🎉
Python
使用 LangChain Python 与 HuggingFace 中心工具集成。
Huggingface 工具(支持文本 I/O)可以直接使用 load_huggingface_tool 函数加载。
load_huggingface_tool
# 需要 transformers>=4.29.0 和 huggingface_hub>=0.14.1 pip install -qU transformers huggingface_hub > /dev/null
pip install -qU langchain-community
from langchain_community.agent_toolkits.load_tools import load_huggingface_tool tool = load_huggingface_tool("lysandre/hf-model-downloads") print(f"{tool.name}: {tool.description}")
model_download_counter: 这是一个返回 Hugging Face 中心上给定任务下载量最多模型的工具。它接受类别名称(例如 text-classification、depth-estimation 等),并返回检查点的名称
tool.run("text-classification")
'facebook/bart-large-mnli'