code
Browse files
app.py
CHANGED
@@ -61,34 +61,30 @@ def respond(
|
|
61 |
yield response
|
62 |
|
63 |
with gr.Blocks() as demo:
|
64 |
-
gr.
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
gr.
|
80 |
-
gr.Slider(minimum=1, maximum=
|
81 |
-
gr.Slider(minimum=0
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
),
|
89 |
-
gr.Slider(minimum=0, maximum=20091114, value=42, step=1, label="seed"),
|
90 |
-
],
|
91 |
-
)
|
92 |
|
93 |
|
94 |
if __name__ == "__main__":
|
|
|
61 |
yield response
|
62 |
|
63 |
with gr.Blocks() as demo:
|
64 |
+
with gr.Row():
|
65 |
+
gr.LoginButton(min_width=100)
|
66 |
+
gr.Markdown("""
|
67 |
+
This is the space I built.
|
68 |
+
As of 2025/1/7, this is the first phi-4 space.
|
69 |
+
If this helps you, and if you have enough money, can you give me 1$? I am facing a financial crisis.
|
70 |
+
If you do this, I will pass on the kindness.
|
71 |
+
This is my bank card number:5592921230414708
|
72 |
+
Thank you!!
|
73 |
+
""")
|
74 |
+
|
75 |
+
with gr.Row():
|
76 |
+
with gr.Column():
|
77 |
+
system_message = gr.Textbox(value="You are a friendly Chatbot.", label="System message")
|
78 |
+
max_tokens = gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens")
|
79 |
+
temperature = gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature")
|
80 |
+
top_p = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)")
|
81 |
+
seed = gr.Slider(minimum=0, maximum=20091114, value=42, step=1, label="Seed")
|
82 |
+
|
83 |
+
with gr.Column():
|
84 |
+
gr.ChatInterface(
|
85 |
+
respond,
|
86 |
+
additional_inputs=[system_message, max_tokens, temperature, top_p, seed],
|
87 |
+
)
|
|
|
|
|
|
|
|
|
88 |
|
89 |
|
90 |
if __name__ == "__main__":
|