wiknwo commited on
Commit
64f3ef3
·
verified ·
1 Parent(s): 4c70506

Fixed the issue with self and HfApi

Browse files
Files changed (1) hide show
  1. tools.py +2 -2
tools.py CHANGED
@@ -1,6 +1,6 @@
1
  from smolagents import Tool
2
  import random
3
- from huggingface_hub import HfApi
4
 
5
  class WeatherInfoTool(Tool):
6
  name = "weather_info"
@@ -38,7 +38,7 @@ class HubStatsTool(Tool):
38
  def forward(self, author: str):
39
  try:
40
  # List models from the specified author, sorted by downloads
41
- models = list(HfApi.list_models(author=author, sort="downloads", limit=1))
42
 
43
  if models:
44
  model = models[-1]
 
1
  from smolagents import Tool
2
  import random
3
+ from huggingface_hub import list_models
4
 
5
  class WeatherInfoTool(Tool):
6
  name = "weather_info"
 
38
  def forward(self, author: str):
39
  try:
40
  # List models from the specified author, sorted by downloads
41
+ models = list(list_models(author=author, sort="downloads"))
42
 
43
  if models:
44
  model = models[-1]