Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -114,6 +114,7 @@ with gr.Blocks(css='style.css') as demo:
|
|
114 |
undo_button = gr.Button('↩️ Undo', variant='secondary')
|
115 |
clear_button = gr.Button('🗑️ Clear', variant='secondary')
|
116 |
|
|
|
117 |
saved_input = gr.State()
|
118 |
|
119 |
with gr.Accordion(label='Advanced options', open=False):
|
@@ -165,6 +166,20 @@ with gr.Blocks(css='style.css') as demo:
|
|
165 |
|
166 |
gr.Markdown(LICENSE)
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
textbox.submit(
|
169 |
fn=clear_and_save_textbox,
|
170 |
inputs=textbox,
|
|
|
114 |
undo_button = gr.Button('↩️ Undo', variant='secondary')
|
115 |
clear_button = gr.Button('🗑️ Clear', variant='secondary')
|
116 |
|
117 |
+
api_button = gr.Button('API', variant='secondary')
|
118 |
saved_input = gr.State()
|
119 |
|
120 |
with gr.Accordion(label='Advanced options', open=False):
|
|
|
166 |
|
167 |
gr.Markdown(LICENSE)
|
168 |
|
169 |
+
api_button.submit(
|
170 |
+
fn=generate,
|
171 |
+
inputs=[
|
172 |
+
message,
|
173 |
+
system_prompt,
|
174 |
+
max_new_tokens,
|
175 |
+
temperature,
|
176 |
+
top_p,
|
177 |
+
top_k,
|
178 |
+
],
|
179 |
+
outputs=chatbot,
|
180 |
+
api_name="llama_api",
|
181 |
+
)
|
182 |
+
|
183 |
textbox.submit(
|
184 |
fn=clear_and_save_textbox,
|
185 |
inputs=textbox,
|