增加环绕侦察场景适配

This commit is contained in:
2026-01-08 15:44:38 +08:00
parent 3eba1f962b
commit 10c5bb5a8a
5441 changed files with 40219 additions and 379695 deletions

View File

@@ -96,7 +96,7 @@ TokenOpt = Annotated[
]
PrivateOpt = Annotated[
bool,
Optional[bool],
typer.Option(
help="Whether to create a private repo if repo doesn't exist on the Hub. Ignored if the repo already exists.",
),
@@ -144,6 +144,7 @@ def _check_cli_update() -> None:
return
# Touch the file to mark that we did the check now
Path(constants.CHECK_FOR_UPDATE_DONE_PATH).parent.mkdir(parents=True, exist_ok=True)
Path(constants.CHECK_FOR_UPDATE_DONE_PATH).touch()
# Check latest version from PyPI

View File

@@ -13,6 +13,7 @@
# limitations under the License.
from huggingface_hub import constants
from huggingface_hub.cli._cli_utils import check_cli_update, typer_factory
from huggingface_hub.cli.auth import auth_cli
from huggingface_hub.cli.cache import cache_cli
@@ -51,7 +52,8 @@ app.add_typer(ie_cli, name="endpoints")
def main():
logging.set_verbosity_info()
if not constants.HF_DEBUG:
logging.set_verbosity_info()
check_cli_update()
app()

View File

@@ -5,7 +5,7 @@ from typing import Annotated, Optional
import typer
from huggingface_hub._inference_endpoints import InferenceEndpoint
from huggingface_hub._inference_endpoints import InferenceEndpoint, InferenceEndpointScalingMetric
from huggingface_hub.errors import HfHubHTTPError
from ._cli_utils import TokenOpt, get_hf_api, typer_factory
@@ -112,6 +112,36 @@ def deploy(
),
] = None,
token: TokenOpt = None,
min_replica: Annotated[
int,
typer.Option(
help="The minimum number of replicas (instances) to keep running for the Inference Endpoint.",
),
] = 1,
max_replica: Annotated[
int,
typer.Option(
help="The maximum number of replicas (instances) to scale to for the Inference Endpoint.",
),
] = 1,
scale_to_zero_timeout: Annotated[
Optional[int],
typer.Option(
help="The duration in minutes before an inactive endpoint is scaled to zero.",
),
] = None,
scaling_metric: Annotated[
Optional[InferenceEndpointScalingMetric],
typer.Option(
help="The metric reference for scaling.",
),
] = None,
scaling_threshold: Annotated[
Optional[float],
typer.Option(
help="The scaling metric threshold used to trigger a scale up. Ignored when scaling metric is not provided.",
),
] = None,
) -> None:
"""Deploy an Inference Endpoint from a Hub repository."""
api = get_hf_api(token=token)
@@ -127,6 +157,11 @@ def deploy(
namespace=namespace,
task=task,
token=token,
min_replica=min_replica,
max_replica=max_replica,
scaling_metric=scaling_metric,
scaling_threshold=scaling_threshold,
scale_to_zero_timeout=scale_to_zero_timeout,
)
_print_endpoint(endpoint)
@@ -262,6 +297,18 @@ def update(
help="The duration in minutes before an inactive endpoint is scaled to zero.",
),
] = None,
scaling_metric: Annotated[
Optional[InferenceEndpointScalingMetric],
typer.Option(
help="The metric reference for scaling.",
),
] = None,
scaling_threshold: Annotated[
Optional[float],
typer.Option(
help="The scaling metric threshold used to trigger a scale up. Ignored when scaling metric is not provided.",
),
] = None,
token: TokenOpt = None,
) -> None:
"""Update an existing endpoint."""
@@ -280,6 +327,8 @@ def update(
min_replica=min_replica,
max_replica=max_replica,
scale_to_zero_timeout=scale_to_zero_timeout,
scaling_metric=scaling_metric,
scaling_threshold=scaling_threshold,
token=token,
)
except HfHubHTTPError as error:

View File

@@ -66,7 +66,7 @@ def repo_create(
help="Hugging Face Spaces SDK type. Required when --type is set to 'space'.",
),
] = None,
private: PrivateOpt = False,
private: PrivateOpt = None,
token: TokenOpt = None,
exist_ok: Annotated[
bool,

View File

@@ -80,7 +80,7 @@ def upload(
] = None,
repo_type: RepoTypeOpt = RepoType.model,
revision: RevisionOpt = None,
private: PrivateOpt = False,
private: PrivateOpt = None,
include: Annotated[
Optional[list[str]],
typer.Option(

View File

@@ -38,7 +38,7 @@ def upload_large_folder(
],
repo_type: RepoTypeOpt = RepoType.model,
revision: RevisionOpt = None,
private: PrivateOpt = False,
private: PrivateOpt = None,
include: Annotated[
Optional[list[str]],
typer.Option(