test-rtechs commited on
Commit
4c83015
·
verified ·
1 Parent(s): d5e579e

Update app_rvc.py

Browse files
Files changed (1) hide show
  1. app_rvc.py +5 -4
app_rvc.py CHANGED
@@ -103,7 +103,8 @@ import time
103
  import hashlib
104
  import sys
105
 
106
- PUBLIC_SHARE = os.environ.get('GRADIO_SHARE', 'False').lower() == 'true'
 
107
 
108
  directories = [
109
  "downloads",
@@ -2872,7 +2873,7 @@ def create_parser():
2872
  parser.add_argument(
2873
  "--public_url",
2874
  action="store_true",
2875
- default=True,
2876
  help="Enable public link",
2877
  )
2878
  parser.add_argument(
@@ -2933,8 +2934,8 @@ if __name__ == "__main__":
2933
 
2934
  app.launch(
2935
  max_threads=1,
2936
- share=PUBLIC_SHARE,
2937
  show_error=True,
2938
  quiet=False,
2939
  debug=(True if logger.isEnabledFor(logging.DEBUG) else False),
2940
- )
 
103
  import hashlib
104
  import sys
105
 
106
+ IS_HUGGINGFACE_SPACE = os.environ.get('SPACE_ID') is not None
107
+ FORCE_PUBLIC_SHARE = os.environ.get('FORCE_PUBLIC_SHARE', 'False').lower() == 'true'
108
 
109
  directories = [
110
  "downloads",
 
2873
  parser.add_argument(
2874
  "--public_url",
2875
  action="store_true",
2876
+ default=False,
2877
  help="Enable public link",
2878
  )
2879
  parser.add_argument(
 
2934
 
2935
  app.launch(
2936
  max_threads=1,
2937
+ share=IS_HUGGINGFACE_SPACE or FORCE_PUBLIC_SHARE,
2938
  show_error=True,
2939
  quiet=False,
2940
  debug=(True if logger.isEnabledFor(logging.DEBUG) else False),
2941
+ )