hf-gradio is an extension of the Hugging Face CLI, designed to streamline interaction with Gradio Spaces and Apps. It provides command-line tools for tasks like running, deploying, and managing Gradio applications on the Hugging Face Hub, alongside a Python API that extends `gradio_client.Client` with Hugging Face integration. The current version is 0.3.0, and it generally follows the release cadence of Gradio and Hugging Face Hub libraries, with frequent updates during its early development phase.
pip install hf-gradioVerified import paths — ran on the pinned version, not inferred.
Demonstrates connecting to a public Gradio Space using `hf_gradio.client.GradioClient` and making a simple prediction. It includes a placeholder for an optional Hugging Face token, which is crucial for private spaces or rate-limited public access.
Consult the official GitHub README for comprehensive CLI examples. Use `gradio_client.Client` directly if you only need programmatic interaction with a Gradio app without the specific Hugging Face Hub integration provided by `hf-gradio`'s client.
Set your Hugging Face token: `export HF_TOKEN='hf_YOUR_TOKEN'` (for CLI/environment) or pass `hf_token='hf_YOUR_TOKEN'` when initializing `GradioClient` or using relevant programmatic functions.
Always pin your `hf-gradio` version in `requirements.txt` (e.g., `hf-gradio==0.3.0`) and consult the GitHub releases and changelog before upgrading, especially across minor version bumps, to anticipate changes.