Update app.py
Browse files
app.py
CHANGED
@@ -43,31 +43,31 @@ def respond(
|
|
43 |
"""
|
44 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
45 |
"""
|
46 |
-
with gr.Blocks() as demo:
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
)
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
60 |
-
gr.Slider(minimum=0.1, maximum=4.0, value=0.75, step=0.1, label="Temperature"),
|
61 |
-
gr.Slider(
|
62 |
-
minimum=0.1,
|
63 |
-
maximum=1.0,
|
64 |
-
value=0.95,
|
65 |
-
step=0.05,
|
66 |
-
label="Top-p (nucleus sampling)",
|
67 |
-
),
|
68 |
-
],
|
69 |
-
)
|
70 |
-
|
71 |
-
|
72 |
-
if __name__ == "__main__":
|
73 |
-
demo.launch()
|
|
|
43 |
"""
|
44 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
45 |
"""
|
46 |
+
with gr.Blocks() as demo:
|
47 |
+
# Adding a label at the top of the page
|
48 |
+
gr.Markdown(
|
49 |
+
"""
|
50 |
+
# Welcome to My Chat Interface
|
51 |
+
This app uses the Llama-3.2-1B-Instruct model to provide conversational AI responses.
|
52 |
+
Adjust the parameters below to customize the chat behavior.
|
53 |
+
"""
|
54 |
+
)
|
55 |
+
demo = gr.ChatInterface(
|
56 |
+
respond,
|
57 |
+
additional_inputs=[
|
58 |
+
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
59 |
+
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
60 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.75, step=0.1, label="Temperature"),
|
61 |
+
gr.Slider(
|
62 |
+
minimum=0.1,
|
63 |
+
maximum=1.0,
|
64 |
+
value=0.95,
|
65 |
+
step=0.05,
|
66 |
+
label="Top-p (nucleus sampling)",
|
67 |
+
),
|
68 |
+
],
|
69 |
)
|
70 |
+
|
71 |
+
|
72 |
+
if __name__ == "__main__":
|
73 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|