drewThomasson commited on
Commit
6466c67
1 Parent(s): 5803af2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -1,5 +1,13 @@
1
  print("starting...")
2
 
 
 
 
 
 
 
 
 
3
  import os
4
  import shutil
5
  import subprocess
@@ -748,4 +756,4 @@ print(f"Running on local URL: http://{local_ip}:7860")
748
  print(f"Running on local URL: http://localhost:7860")
749
 
750
  # Your Gradio launch command
751
- demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
 
1
  print("starting...")
2
 
3
+ import argparse
4
+
5
+ # Argument parser to handle optional parameters
6
+ parser = argparse.ArgumentParser(description="Launch the Gradio app with optional share parameter.")
7
+ parser.add_argument("--share", type=bool, default=False, help="Set to True to enable Gradio share link.")
8
+ args = parser.parse_args()
9
+
10
+
11
  import os
12
  import shutil
13
  import subprocess
 
756
  print(f"Running on local URL: http://localhost:7860")
757
 
758
  # Your Gradio launch command
759
+ demo.launch(server_name="0.0.0.0", server_port=7860, share=args.share)