DimasMP3 commited on
Commit
1b777f5
·
1 Parent(s): 2c35852

Remove deprecated auth_token argument for Gradio 4.44

Browse files
Files changed (1) hide show
  1. app.py +13 -14
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from __future__ import annotations
2
 
3
  import logging
4
  import os
@@ -96,20 +96,19 @@ def build_interface() -> gr.Interface:
96
  def launch_app():
97
  iface = build_interface()
98
 
99
- auth_credentials: Optional[Tuple[str, str]] = None
 
 
 
 
 
 
 
100
  if settings.gradio_username and settings.gradio_password:
101
- auth_credentials = (settings.gradio_username, settings.gradio_password)
102
-
103
- iface.launch(
104
- server_name="0.0.0.0",
105
- server_port=settings.port,
106
- share=settings.share,
107
- auth=auth_credentials,
108
- auth_message="Masukkan kredensial untuk mengakses demo",
109
- auth_token=settings.gradio_auth_token,
110
- cors=settings.cors_allowed_origins,
111
- show_api=True,
112
- )
113
 
114
 
115
  if __name__ == "__main__":
 
1
+ from __future__ import annotations
2
 
3
  import logging
4
  import os
 
96
  def launch_app():
97
  iface = build_interface()
98
 
99
+ launch_args: Dict[str, object] = {
100
+ "server_name": "0.0.0.0",
101
+ "server_port": settings.port,
102
+ "share": settings.share,
103
+ "cors": settings.cors_allowed_origins,
104
+ "show_api": True,
105
+ }
106
+
107
  if settings.gradio_username and settings.gradio_password:
108
+ launch_args["auth"] = (settings.gradio_username, settings.gradio_password)
109
+ launch_args["auth_message"] = "Masukkan kredensial untuk mengakses demo"
110
+
111
+ iface.launch(**launch_args)
 
 
 
 
 
 
 
 
112
 
113
 
114
  if __name__ == "__main__":