patti-j commited on
Commit
7e320e1
·
1 Parent(s): f5be4ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -18,10 +18,21 @@ def generate_text(prompt):
18
  )
19
  return response.choices[0].text.strip()
20
 
 
 
 
 
 
 
 
 
 
 
 
21
  # Create Gradio interface
22
  password_box = gr.Textbox(label="Enter password", type="password")
23
- input_text = gr.Textbox(label="Enter prompt", type="password")
24
- output_text = gr.Textbox(label="AI Response", type="text")
25
  demo = gr.Interface(
26
  fn=check_password,
27
  inputs=input_text,
@@ -32,16 +43,5 @@ demo = gr.Interface(
32
  theme="default"
33
  )
34
 
35
- # Define password-protected Gradio interface
36
- def check_password(password):
37
- if password == "patti-ai":
38
- demo.interface.visible = True
39
- demo.password_box.visible = False
40
- return "Access granted"
41
- else:
42
- demo.interface.visible = False
43
- demo.password_box.visible = True
44
- return "Access denied"
45
-
46
  # Launch demo
47
  demo.launch()
 
18
  )
19
  return response.choices[0].text.strip()
20
 
21
+ # Define password-protected Gradio interface
22
+ def check_password(password):
23
+ if password == "patti-ai":
24
+ gr.Interface.visible = True
25
+ password_box.visible = False
26
+ return "Access granted"
27
+ else:
28
+ gr.Interface.visible = False
29
+ password_box.visible = True
30
+ return "Access denied"
31
+
32
  # Create Gradio interface
33
  password_box = gr.Textbox(label="Enter password", type="password")
34
+ input_text = gr.Textbox(label="Enter prompt", type="text")
35
+ output_text = gr.Textbox(label="AI response", type="text")
36
  demo = gr.Interface(
37
  fn=check_password,
38
  inputs=input_text,
 
43
  theme="default"
44
  )
45
 
 
 
 
 
 
 
 
 
 
 
 
46
  # Launch demo
47
  demo.launch()