Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,18 +22,19 @@ def generate_text(prompt):
|
|
| 22 |
# pass
|
| 23 |
|
| 24 |
def check_password():
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
print("Incorrect password!")
|
| 28 |
return False
|
| 29 |
return True
|
| 30 |
|
| 31 |
# Create Gradio interface
|
| 32 |
-
password_box = gr.Textbox(label="Enter password", type="password")
|
| 33 |
input_text = gr.Textbox(label="Enter prompt", type="text")
|
| 34 |
output_text = gr.Textbox(label="AI response", type="text")
|
| 35 |
demo = gr.Interface(
|
| 36 |
-
fn = check_password
|
| 37 |
inputs=[password_box, input_text],
|
| 38 |
outputs=output_text,
|
| 39 |
title="AI Chatbot for PlanetTogether Knowledge Base",
|
|
|
|
| 22 |
# pass
|
| 23 |
|
| 24 |
def check_password():
|
| 25 |
+
password_box = gr.Textbox(label="Enter password", type="password")
|
| 26 |
+
|
| 27 |
+
# password = gr.password("Enter password to continue")
|
| 28 |
+
if password != "patti-ai":
|
| 29 |
print("Incorrect password!")
|
| 30 |
return False
|
| 31 |
return True
|
| 32 |
|
| 33 |
# Create Gradio interface
|
|
|
|
| 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(password_box)
|
| 38 |
inputs=[password_box, input_text],
|
| 39 |
outputs=output_text,
|
| 40 |
title="AI Chatbot for PlanetTogether Knowledge Base",
|