artificialguybr commited on
Commit
7e4cf08
1 Parent(s): 6ac567d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -25,10 +25,12 @@ def user(message, history):
25
  def regenerate(history, system_msg, max_tokens, temperature, top_p, top_k, repetition_penalty):
26
  # Remove the last item from the history
27
  if history:
28
- history.pop(-1)
29
 
30
  # Re-execute the chat function
31
- return chat(history, system_msg, max_tokens, temperature, top_p, top_k, repetition_penalty)
 
 
32
 
33
  def chat(history, system_message, max_tokens, temperature, top_p, top_k, repetition_penalty):
34
  history = history or []
@@ -133,5 +135,6 @@ with gr.Blocks() as demo:
133
  )
134
 
135
 
 
136
  demo.queue(max_size=128, concurrency_count=2)
137
  demo.launch()
 
25
  def regenerate(history, system_msg, max_tokens, temperature, top_p, top_k, repetition_penalty):
26
  # Remove the last item from the history
27
  if history:
28
+ del history[-1]
29
 
30
  # Re-execute the chat function
31
+ new_history, _, _ = chat(history, system_msg, max_tokens, temperature, top_p, top_k, repetition_penalty)
32
+ return new_history, new_history, ""
33
+
34
 
35
  def chat(history, system_message, max_tokens, temperature, top_p, top_k, repetition_penalty):
36
  history = history or []
 
135
  )
136
 
137
 
138
+
139
  demo.queue(max_size=128, concurrency_count=2)
140
  demo.launch()