跳至主要内容

HuggingFace 集线器工具

Huggingface 工具,支持文本 I/O 可以使用 load_huggingface_tool 函数直接加载。

# 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_tools import load_huggingface_tool

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

print(f"{tool.name}: {tool.description}")
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'

此页面是否有帮助?


您也可以留下详细的反馈 在 GitHub 上.