Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -84,13 +84,14 @@ def generate(
|
|
84 |
chat_interface = gr.ChatInterface(
|
85 |
fn=generate,
|
86 |
additional_inputs=[
|
87 |
-
gr.Textbox(label="System prompt", lines=6),
|
88 |
gr.Slider(
|
89 |
label="Max new tokens",
|
90 |
minimum=1,
|
91 |
maximum=MAX_MAX_NEW_TOKENS,
|
92 |
step=1,
|
93 |
value=DEFAULT_MAX_NEW_TOKENS,
|
|
|
94 |
),
|
95 |
gr.Slider(
|
96 |
label="Temperature",
|
@@ -98,6 +99,7 @@ chat_interface = gr.ChatInterface(
|
|
98 |
maximum=4.0,
|
99 |
step=0.1,
|
100 |
value=0.6,
|
|
|
101 |
),
|
102 |
gr.Slider(
|
103 |
label="Top-p (nucleus sampling)",
|
@@ -105,6 +107,7 @@ chat_interface = gr.ChatInterface(
|
|
105 |
maximum=1.0,
|
106 |
step=0.05,
|
107 |
value=0.9,
|
|
|
108 |
),
|
109 |
gr.Slider(
|
110 |
label="Top-k",
|
@@ -112,6 +115,7 @@ chat_interface = gr.ChatInterface(
|
|
112 |
maximum=1000,
|
113 |
step=1,
|
114 |
value=50,
|
|
|
115 |
),
|
116 |
gr.Slider(
|
117 |
label="Repetition penalty",
|
@@ -119,6 +123,7 @@ chat_interface = gr.ChatInterface(
|
|
119 |
maximum=2.0,
|
120 |
step=0.05,
|
121 |
value=1.2,
|
|
|
122 |
),
|
123 |
],
|
124 |
stop_btn=None,
|
@@ -132,10 +137,10 @@ chat_interface = gr.ChatInterface(
|
|
132 |
)
|
133 |
|
134 |
with gr.Blocks(css="style.css") as demo:
|
135 |
-
gr.Markdown(DESCRIPTION)
|
136 |
# gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
|
137 |
chat_interface.render()
|
138 |
-
gr.Markdown(LICENSE)
|
139 |
|
140 |
if __name__ == "__main__":
|
141 |
demo.queue(max_size=20).launch()
|
|
|
84 |
chat_interface = gr.ChatInterface(
|
85 |
fn=generate,
|
86 |
additional_inputs=[
|
87 |
+
gr.Textbox(label="System prompt", lines=6, elem_classes="contain")),
|
88 |
gr.Slider(
|
89 |
label="Max new tokens",
|
90 |
minimum=1,
|
91 |
maximum=MAX_MAX_NEW_TOKENS,
|
92 |
step=1,
|
93 |
value=DEFAULT_MAX_NEW_TOKENS,
|
94 |
+
elem_classes="contain",
|
95 |
),
|
96 |
gr.Slider(
|
97 |
label="Temperature",
|
|
|
99 |
maximum=4.0,
|
100 |
step=0.1,
|
101 |
value=0.6,
|
102 |
+
elem_classes="contain",
|
103 |
),
|
104 |
gr.Slider(
|
105 |
label="Top-p (nucleus sampling)",
|
|
|
107 |
maximum=1.0,
|
108 |
step=0.05,
|
109 |
value=0.9,
|
110 |
+
elem_classes="contain",
|
111 |
),
|
112 |
gr.Slider(
|
113 |
label="Top-k",
|
|
|
115 |
maximum=1000,
|
116 |
step=1,
|
117 |
value=50,
|
118 |
+
elem_classes="contain",
|
119 |
),
|
120 |
gr.Slider(
|
121 |
label="Repetition penalty",
|
|
|
123 |
maximum=2.0,
|
124 |
step=0.05,
|
125 |
value=1.2,
|
126 |
+
elem_classes="contain",
|
127 |
),
|
128 |
],
|
129 |
stop_btn=None,
|
|
|
137 |
)
|
138 |
|
139 |
with gr.Blocks(css="style.css") as demo:
|
140 |
+
gr.Markdown(DESCRIPTION,elem_classes="contain")
|
141 |
# gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
|
142 |
chat_interface.render()
|
143 |
+
gr.Markdown(LICENSE,elem_classes="contain")
|
144 |
|
145 |
if __name__ == "__main__":
|
146 |
demo.queue(max_size=20).launch()
|