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

chore/feat: Add GRADIO_ANALYTICS_ENABLED=False to disable Gradio analytics & set Gradio Title #130

Open
wants to merge 2 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
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ services:
command: ["python3", "gradio_interface.py"]
environment:
- NVIDIA_VISIBLE_DEVICES=0
- GRADIO_SHARE=False
- GRADIO_SHARE=False
- GRADIO_ANALYTICS_ENABLED=False
8 changes: 5 additions & 3 deletions gradio_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def update_progress(_frame: torch.Tensor, step: int, _total_steps: int) -> bool:
return (sr_out, wav_out.squeeze().numpy()), seed


def build_interface():
def build_interface(analytics, title):
supported_models = []
if "transformer" in ZonosBackbone.supported_architectures:
supported_models.append("Zyphra/Zonos-v0.1-transformer")
Expand All @@ -216,7 +216,7 @@ def build_interface():
"| This probably means the mamba-ssm library has not been installed."
)

with gr.Blocks() as demo:
with gr.Blocks(analytics_enabled=analytics, title=title) as demo:
with gr.Row():
with gr.Column():
model_choice = gr.Dropdown(
Expand Down Expand Up @@ -414,6 +414,8 @@ def build_interface():


if __name__ == "__main__":
demo = build_interface()
analytics = getenv("GRADIO_ANALYTICS_ENABLED", "False").lower() in ("true", "1", "t")
title = getenv("APP_NAME", "Zonos")
demo = build_interface(analytics, title)
share = getenv("GRADIO_SHARE", "False").lower() in ("true", "1", "t")
demo.launch(server_name="0.0.0.0", server_port=7860, share=share)