Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,26 +27,24 @@ def generate_text(prompt):
|
|
| 27 |
# demo.interface.visible = False
|
| 28 |
# demo.password_box.visible = True
|
| 29 |
|
| 30 |
-
def check_password():
|
| 31 |
password = gr.password("Enter password to continue")
|
| 32 |
-
if password != "
|
| 33 |
print("Incorrect password!")
|
| 34 |
return False
|
| 35 |
return True
|
| 36 |
|
| 37 |
-
|
| 38 |
# Create Gradio interface
|
| 39 |
input_text = gr.Textbox(label="Enter prompt", placeholder="Enter prompt", type="password", lines=2)
|
| 40 |
output_text = gr.Textbox(label="AI Response", placeholder="AI Response", type="text", )
|
| 41 |
demo = gr.Interface(
|
| 42 |
-
fn=
|
| 43 |
inputs=input_text,
|
| 44 |
outputs=output_text,
|
| 45 |
title="AI Chatbot for PlanetTogether Knowledge Base",
|
| 46 |
-
description="Ask a question about the PlanetTogether APS",
|
| 47 |
examples=[["How do you create an Alternate Path?"]],
|
| 48 |
-
theme="default"
|
| 49 |
-
onloading=[check_password]
|
| 50 |
)
|
| 51 |
|
| 52 |
# Launch demo
|
|
|
|
| 27 |
# demo.interface.visible = False
|
| 28 |
# demo.password_box.visible = True
|
| 29 |
|
| 30 |
+
def check_password(password):
|
| 31 |
password = gr.password("Enter password to continue")
|
| 32 |
+
if password != "password":
|
| 33 |
print("Incorrect password!")
|
| 34 |
return False
|
| 35 |
return True
|
| 36 |
|
|
|
|
| 37 |
# Create Gradio interface
|
| 38 |
input_text = gr.Textbox(label="Enter prompt", placeholder="Enter prompt", type="password", lines=2)
|
| 39 |
output_text = gr.Textbox(label="AI Response", placeholder="AI Response", type="text", )
|
| 40 |
demo = gr.Interface(
|
| 41 |
+
fn=check_password,
|
| 42 |
inputs=input_text,
|
| 43 |
outputs=output_text,
|
| 44 |
title="AI Chatbot for PlanetTogether Knowledge Base",
|
| 45 |
+
description="Ask a question about the PlanetTogether APS:",
|
| 46 |
examples=[["How do you create an Alternate Path?"]],
|
| 47 |
+
theme="default"
|
|
|
|
| 48 |
)
|
| 49 |
|
| 50 |
# Launch demo
|