Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ def get_version() -> str:
extras_require=extras,
entry_points={
"console_scripts": [
"huggingface-cli=huggingface_hub.commands.huggingface_cli:main",
"hf=huggingface_hub.cli.hf:main",
"tiny-agents=huggingface_hub.inference._mcp.cli:app",
],
Expand Down
4 changes: 2 additions & 2 deletions src/huggingface_hub/_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from typing import Optional

from . import constants
from .commands._cli_utils import ANSI
from .cli._cli_utils import ANSI
from .utils import (
capture_output,
get_token,
Expand Down Expand Up @@ -244,7 +244,7 @@ def interpreter_login(*, skip_if_logged_in: bool = False) -> None:
logger.info("User is already logged in.")
return

from .commands.delete_cache import _ask_for_confirmation_no_tui
from .cli.cache import _ask_for_confirmation_no_tui

print(_HF_LOGO_ASCII)
if get_token() is not None:
Expand Down
18 changes: 12 additions & 6 deletions src/huggingface_hub/cli/_cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@

import os
from enum import Enum
from typing import Annotated, Optional, Union
from typing import TYPE_CHECKING, Annotated, Optional, Union

import click
import typer

from huggingface_hub import __version__
from huggingface_hub.hf_api import HfApi


if TYPE_CHECKING:
from huggingface_hub.hf_api import HfApi


def get_hf_api(token: Optional[str] = None) -> "HfApi":
# Import here to avoid circular import
from huggingface_hub.hf_api import HfApi

return HfApi(token=token, library_name="hf", library_version=__version__)


class ANSI:
Expand Down Expand Up @@ -140,7 +150,3 @@ class RepoType(str, Enum):
help="Git revision id which can be a branch name, a tag, or a commit hash.",
),
]


def get_hf_api(token: Optional[str] = None) -> HfApi:
return HfApi(token=token, library_name="hf", library_version=__version__)
27 changes: 0 additions & 27 deletions src/huggingface_hub/commands/__init__.py

This file was deleted.

74 changes: 0 additions & 74 deletions src/huggingface_hub/commands/_cli_utils.py

This file was deleted.

Loading