patti-j commited on
Commit
9b41793
·
1 Parent(s): 5ff04cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -17
app.py CHANGED
@@ -33,20 +33,11 @@ def generate_text(prompt):
33
  theme="default"
34
  )
35
 
36
- # Add password field to header
37
- demo.add_header("Enter Password", type="password")
38
-
39
- # Function to check password and show/hide inputs/output
40
- def check_password(password_input):
41
- if password_input == password:
42
- demo.show_input()
43
- demo.show_output()
44
- else:
45
- demo.hide_input()
46
- demo.hide_output()
47
-
48
- # Set the callback function for password field
49
- demo.set_config(callback=check_password)
50
-
51
- # Launch demo
52
- demo.launch(share=True)
 
33
  theme="default"
34
  )
35
 
36
+ demo.password_box = password_box
37
+
38
+ # Set the initial state of the interface
39
+ demo.interface.visible = False
40
+
41
+ # Launch demo with password protection
42
+ demo.launch(config={"callbacks": [check_password]})
43
+