Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -47,28 +47,28 @@ def respond(
|
|
47 |
"""
|
48 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
49 |
"""
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
password = gr.Textbox(placeholder="Provide password...")
|
71 |
-
|
72 |
def set_password(new_password):
|
73 |
return new_password
|
74 |
|
|
|
47 |
"""
|
48 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
49 |
"""
|
50 |
+
with gr.Blocks() as demo:
|
51 |
+
credentials = gr.State("")
|
52 |
+
|
53 |
+
if credentials == getenv("PASSWORD"):
|
54 |
+
gr.ChatInterface(
|
55 |
+
respond,
|
56 |
+
additional_inputs=[
|
57 |
+
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
58 |
+
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
59 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
60 |
+
gr.Slider(
|
61 |
+
minimum=0.1,
|
62 |
+
maximum=1.0,
|
63 |
+
value=0.95,
|
64 |
+
step=0.05,
|
65 |
+
label="Top-p (nucleus sampling)",
|
66 |
+
),
|
67 |
+
],
|
68 |
+
)
|
69 |
+
else:
|
70 |
password = gr.Textbox(placeholder="Provide password...")
|
71 |
+
|
72 |
def set_password(new_password):
|
73 |
return new_password
|
74 |
|