Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --share flag to CLI command #9585

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .changeset/clear-queens-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": minor
---

feat:Add --share flag to CLI command
2 changes: 2 additions & 0 deletions gradio/cli/commands/reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def main(
demo_name: str = "demo",
watch_dirs: Optional[list[str]] = None,
encoding: str = "utf-8",
share: bool = False,
):
# default execution pattern to start the server and watch changes
module_name, path, watch_sources, demo_name = _setup_config(
Expand All @@ -124,6 +125,7 @@ def main(
GRADIO_WATCH_MODULE_NAME=module_name,
GRADIO_WATCH_DEMO_NAME=demo_name,
GRADIO_WATCH_DEMO_PATH=str(path),
GRADIO_SHARE=str(share),
),
)
if popen.poll() is None:
Expand Down
2 changes: 1 addition & 1 deletion gradio/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"COULD_NOT_GET_SHARE_LINK": "\nCould not create share link. Please check your internet connection or our status page: https://status.gradio.app.",
"COULD_NOT_GET_SHARE_LINK_MISSING_FILE": "\nCould not create share link. Missing file: {}. \n\nPlease check your internet connection. This can happen if your antivirus software blocks the download of this file. You can install manually by following these steps: \n\n1. Download this file: {}\n2. Rename the downloaded file to: {}\n3. Move the file to this location: {}",
"COLAB_NO_LOCAL": "Cannot display local interface on google colab, public link created.",
"PUBLIC_SHARE_TRUE": "\nTo create a public link, set `share=True` in `launch()`.",
"PUBLIC_SHARE_TRUE": "\nTo create a public link, set `share=True` in `launch()` or use the --share flag in the command line.",
"MODEL_PUBLICLY_AVAILABLE_URL": "Model available publicly at: {} (may take up to a minute for link to be usable)",
"GENERATING_PUBLIC_LINK": "Generating public link (may take a few seconds...):",
"BETA_INVITE": "\nThanks for being a Gradio user! If you have questions or feedback, please join our Discord server and chat with us: https://discord.gg/feTf9x3ZSB",
Expand Down
Loading