Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -52,30 +52,31 @@ with gr.Blocks() as demo:
|
|
52 |
|
53 |
print("CREDENTIALS:")
|
54 |
print(credentials)
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
79 |
|
80 |
|
81 |
if __name__ == "__main__":
|
|
|
52 |
|
53 |
print("CREDENTIALS:")
|
54 |
print(credentials)
|
55 |
+
@gr.render(inputs=credentials)
|
56 |
+
def app(app_credentials):
|
57 |
+
if app_credentials == "2024":
|
58 |
+
gr.ChatInterface(
|
59 |
+
respond,
|
60 |
+
additional_inputs=[
|
61 |
+
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
62 |
+
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
63 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
64 |
+
gr.Slider(
|
65 |
+
minimum=0.1,
|
66 |
+
maximum=1.0,
|
67 |
+
value=0.95,
|
68 |
+
step=0.05,
|
69 |
+
label="Top-p (nucleus sampling)",
|
70 |
+
),
|
71 |
+
],
|
72 |
+
)
|
73 |
+
else:
|
74 |
+
password = gr.Textbox(placeholder="Provide password...")
|
75 |
+
|
76 |
+
def set_password(password):
|
77 |
+
return password
|
78 |
+
|
79 |
+
gr.Button("Login").click(set_password, [password], credentials)
|
80 |
|
81 |
|
82 |
if __name__ == "__main__":
|