Voice et bot modif
This commit is contained in:
parent
189d56026b
commit
7333a22bcd
10774 changed files with 634644 additions and 933308 deletions
|
|
@ -11,16 +11,15 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
"""Contains commands to print information about the environment and version.
|
||||
"""Contains commands to print information about the environment and version."""
|
||||
|
||||
Usage:
|
||||
hf env
|
||||
hf version
|
||||
"""
|
||||
import typer
|
||||
|
||||
from huggingface_hub import __version__
|
||||
|
||||
from ..utils import dump_environment_info
|
||||
from ._cli_utils import _fetch_latest_pypi_version, run_update
|
||||
from ._output import out
|
||||
|
||||
|
||||
def env() -> None:
|
||||
|
|
@ -29,5 +28,23 @@ def env() -> None:
|
|||
|
||||
|
||||
def version() -> None:
|
||||
"""Print CLI version."""
|
||||
print(__version__)
|
||||
"""Print information about the hf version."""
|
||||
out.result("hf version", version=__version__)
|
||||
|
||||
|
||||
def update() -> None:
|
||||
"""Update the `hf` CLI to the latest version."""
|
||||
out.text(f"Current version: {__version__}")
|
||||
out.text("Checking for updates to latest version...")
|
||||
latest_version = _fetch_latest_pypi_version("huggingface_hub")
|
||||
if latest_version is not None and __version__ == latest_version:
|
||||
out.text(f"hf is up to date ({__version__})")
|
||||
return
|
||||
|
||||
returncode = run_update()
|
||||
if returncode != 0:
|
||||
raise typer.Exit(code=returncode)
|
||||
out.hint(
|
||||
"You may also want to run `hf skills update` to refresh any installed skills "
|
||||
"so your AI agent sees the latest command surface."
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue