mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-08 10:55:18 +03:00
2.4 KiB
2.4 KiB
In [ ]:
# Requires transformers>=4.29.0 and huggingface_hub>=0.14.1
!pip install --upgrade transformers huggingface_hub > /dev/nullIn [1]:
from langchain.agents 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
In [2]:
tool.run("text-classification")Out [2]:
'facebook/bart-large-mnli'
In [ ]: