Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,17 +59,16 @@ demo = gr.Interface(
|
|
| 59 |
fn=generate,
|
| 60 |
inputs=[
|
| 61 |
gr.Textbox(lines=2, label="Input"),
|
| 62 |
-
"state"
|
| 63 |
-
gr.Slider(0, 1, value=0.25, label="Temperature"),
|
| 64 |
-
gr.Slider(1, 2048, value=512, step=1, label="Max Tokens"),
|
| 65 |
-
gr.Slider(0, 1, value=0.95, label="Top P"),
|
| 66 |
-
gr.Slider(1, 2, value=1.0, label="Repetition Penalty"),
|
| 67 |
-
prompt_type_dropdown
|
| 68 |
],
|
| 69 |
outputs=[samir_chatbot],
|
| 70 |
title="Tutorial Master",
|
| 71 |
theme=theme
|
| 72 |
)
|
| 73 |
|
| 74 |
-
#
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
fn=generate,
|
| 60 |
inputs=[
|
| 61 |
gr.Textbox(lines=2, label="Input"),
|
| 62 |
+
"state" # State input for conversation history
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
],
|
| 64 |
outputs=[samir_chatbot],
|
| 65 |
title="Tutorial Master",
|
| 66 |
theme=theme
|
| 67 |
)
|
| 68 |
|
| 69 |
+
# Inside generate function:
|
| 70 |
+
def generate(prompt, history, ...):
|
| 71 |
+
# Update history using the state object
|
| 72 |
+
# ...
|
| 73 |
+
|
| 74 |
+
return output, updated_history # Return bo
|