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
2 changes: 1 addition & 1 deletion docs/source/en/guides/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ First of all, let's install the CLI:
```

> [!TIP]
> The CLI ships with the core `huggingface_hub` package, so there is no longer a `[cli]` extra to install.
> The CLI ships with the core `huggingface_hub` package.

Alternatively, you can install the `hf` CLI with a single command:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/ko/guides/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rendered properly in your Markdown viewer.
```

> [!TIP]
> CLI는 이제 기본 `huggingface_hub` 패키지에 함께 포함되어 별도의 `[cli]` 추가 종속성이 필요하지 않습니다.
> CLI는 기본 `huggingface_hub` 패키지에 포함되어 있습니다.

설치가 완료되면, CLI가 올바르게 설정되었는지 확인할 수 있습니다:

Expand Down
11 changes: 3 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,17 @@ def get_version() -> str:
"filelock",
"fsspec>=2023.5.0",
"hf-xet>=1.1.3,<2.0.0; platform_machine=='x86_64' or platform_machine=='amd64' or platform_machine=='arm64' or platform_machine=='aarch64'",
"httpx>=0.23.0, <1",
"packaging>=20.9",
"pyyaml>=5.1",
"httpx>=0.23.0, <1",
"shellingham",
"tqdm>=4.42.1",
"typer-slim",
"typing-extensions>=3.7.4.3", # to be able to import TypeAlias
]

extras = {}

extras["cli"] = [
"InquirerPy==0.3.4", # Note: installs `prompt-toolkit` in the background
"shellingham",
]

extras["inference"] = [
"aiohttp", # for AsyncInferenceClient
]
Expand Down Expand Up @@ -64,8 +60,7 @@ def get_version() -> str:
] + extras["inference"]

extras["testing"] = (
extras["cli"]
+ extras["inference"]
extras["inference"]
+ extras["oauth"]
+ [
"jedi",
Expand Down
20 changes: 0 additions & 20 deletions src/huggingface_hub/cli/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@

logger = logging.get_logger(__name__)

try:
from InquirerPy import inquirer
from InquirerPy.base.control import Choice

_inquirer_py_available = True
except ImportError:
_inquirer_py_available = False


auth_cli = typer_factory(help="Manage authentication (login, logout, etc.).")

Expand Down Expand Up @@ -89,18 +81,6 @@ def _select_token_name() -> Optional[str]:
logger.error("No stored tokens found. Please login first.")
return None

if _inquirer_py_available:
choices = [Choice(token_name, name=token_name) for token_name in token_names]
try:
return inquirer.select(
message="Select a token to switch to:",
choices=choices,
default=None,
).execute()
except KeyboardInterrupt:
logger.info("Token selection cancelled.")
return None
# if inquirer is not available, use a simpler terminal UI
print("Available stored tokens:")
for i, token_name in enumerate(token_names, 1):
print(f"{i}. {token_name}")
Expand Down
12 changes: 6 additions & 6 deletions utils/installers/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Installs the Hugging Face CLI on Windows by creating an isolated virtual environment and exposing the `hf` command.

.DESCRIPTION
Downloads and installs the `huggingface_hub[cli]` package into a dedicated virtual environment, then copies the generated `hf.exe` console script to a directory on the user's PATH.
Downloads and installs the `huggingface_hub` package into a dedicated virtual environment, then copies the generated `hf.exe` console script to a directory on the user's PATH.

.PARAMETER Force
Recreates the virtual environment even if it already exists. Off by default.
Expand Down Expand Up @@ -235,13 +235,13 @@ function New-VirtualEnvironment {
}

function Install-HuggingFaceHub {
$packageSpec = 'huggingface_hub[cli]'
$packageSpec = 'huggingface_hub'
$requestedVersion = $env:HF_CLI_VERSION
if ($requestedVersion) {
$packageSpec = "huggingface_hub[cli]==$requestedVersion"
Write-Log "Installing huggingface_hub[cli] (version $requestedVersion)..."
$packageSpec = "huggingface_hub==$requestedVersion"
Write-Log "Installing The Hugging Face CLI (version $requestedVersion)..."
} else {
Write-Log "Installing huggingface_hub[cli] (latest)..."
Write-Log "Installing The Hugging Face CLI (latest)..."
}
if (-not $script:VenvPython) { $script:VenvPython = Join-Path $SCRIPTS_DIR "python.exe" }

Expand All @@ -267,7 +267,7 @@ function Publish-HfCommand {

$hfExeSource = Join-Path $SCRIPTS_DIR "hf.exe"
if (-not (Test-Path $hfExeSource)) {
throw "hf.exe not found in virtual environment. Check that huggingface_hub[cli] installed correctly."
throw "hf.exe not found in virtual environment. Check that The Hugging Face CLI installed correctly."
}

$hfExeTarget = Join-Path $BIN_DIR "hf.exe"
Expand Down
10 changes: 5 additions & 5 deletions utils/installers/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,12 @@ create_venv() {

# Install huggingface_hub with CLI extras
install_hf_hub() {
local package_spec="huggingface_hub[cli]"
local package_spec="huggingface_hub"
if [ -n "$REQUESTED_VERSION" ]; then
package_spec="huggingface_hub[cli]==$REQUESTED_VERSION"
log_info "Installing huggingface_hub[cli] (version $REQUESTED_VERSION)..."
package_spec="huggingface_hub==$REQUESTED_VERSION"
log_info "Installing The Hugging Face CLI (version $REQUESTED_VERSION)..."
else
log_info "Installing huggingface_hub[cli] (latest)..."
log_info "Installing The Hugging Face CLI (latest)..."
fi

local extra_pip_args="${HF_CLI_PIP_ARGS:-${HF_PIP_ARGS:-}}"
Expand Down Expand Up @@ -318,7 +318,7 @@ expose_cli_command() {
local source_cli="$VENV_DIR/bin/hf"
if [ ! -x "$source_cli" ]; then
log_error "hf command not found in the virtual environment at $source_cli"
log_error "Verify that huggingface_hub[cli] installed correctly."
log_error "Verify that The Hugging Face CLI is installed correctly."
exit 1
fi

Expand Down
Loading