darkc0de commited on
Commit
933c736
·
verified ·
1 Parent(s): 359e4ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -146,12 +146,11 @@ if __name__ == "__main__":
146
  try:
147
  demo.queue(default_concurrency_limit=2)
148
 
149
- demo.launch(show_api=False, share=False)
 
150
  except NameError as ne:
151
  print(f"Gradio demo could not be launched. 'client' might not have been initialized: {ne}")
152
  except RuntimeError as re:
153
  print(f"Gradio demo could not be launched due to an error during client initialization: {re}")
154
  except Exception as e:
155
- print(f"An unexpected error occurred when trying to launch Gradio demo: {e}")
156
-
157
-
 
146
  try:
147
  demo.queue(default_concurrency_limit=2)
148
 
149
+ # The API is now disabled by setting api_open=False.
150
+ demo.launch(api_open=False, share=False)
151
  except NameError as ne:
152
  print(f"Gradio demo could not be launched. 'client' might not have been initialized: {ne}")
153
  except RuntimeError as re:
154
  print(f"Gradio demo could not be launched due to an error during client initialization: {re}")
155
  except Exception as e:
156
+ print(f"An unexpected error occurred when trying to launch Gradio demo: {e}")