Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -35,8 +35,7 @@ def generate(prompt, history, system_prompt, temperature=0.9, max_new_tokens=904
|
|
35 |
output = ""
|
36 |
for response in stream:
|
37 |
output += response.token.text
|
38 |
-
|
39 |
-
return output
|
40 |
|
41 |
additional_inputs = [
|
42 |
gr.Textbox(label="System Prompt", max_lines=1, interactive=True),
|
@@ -53,7 +52,8 @@ with app:
|
|
53 |
submit_btn = gr.Button("Submit")
|
54 |
|
55 |
def process_message(message, history):
|
56 |
-
|
|
|
57 |
return history, ""
|
58 |
|
59 |
submit_btn.click(process_message, inputs=[text_input, chatbot], outputs=[chatbot, text_input])
|
|
|
35 |
output = ""
|
36 |
for response in stream:
|
37 |
output += response.token.text
|
38 |
+
return [(prompt, output)]
|
|
|
39 |
|
40 |
additional_inputs = [
|
41 |
gr.Textbox(label="System Prompt", max_lines=1, interactive=True),
|
|
|
52 |
submit_btn = gr.Button("Submit")
|
53 |
|
54 |
def process_message(message, history):
|
55 |
+
response = generate(message, history, additional_inputs[0].value)
|
56 |
+
history.extend(response)
|
57 |
return history, ""
|
58 |
|
59 |
submit_btn.click(process_message, inputs=[text_input, chatbot], outputs=[chatbot, text_input])
|