FredZhang7 commited on
Commit
cd14260
1 Parent(s): 52faafe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -21,6 +21,7 @@ def generate_prompt(instruction, input=None, history=None):
21
  for pair in history:
22
  if len(pair[0]) > 0 and len(pair[1]) > 0:
23
  history_str += f"User: {pair[0]}\n\nAssistant: {pair[1]}\n\n"
 
24
  if instruction:
25
  instruction = (
26
  instruction.strip()
@@ -206,13 +207,10 @@ with gr.Blocks(title=title) as demo:
206
  return "", history + [[message, None]]
207
 
208
  def respond(history=None):
209
- global msg, token_count_chat, temperature_chat, top_p_chat, presence_penalty_chat, count_penalty_chat
210
 
211
  # get the lastest user message and the additional parameters
212
- print("msg.value = ", msg.value)
213
- print("history = ", history)
214
-
215
- instruction = msg.value
216
  token_count = token_count_chat.value
217
 
218
  temperature = temperature_chat.value
 
21
  for pair in history:
22
  if len(pair[0]) > 0 and len(pair[1]) > 0:
23
  history_str += f"User: {pair[0]}\n\nAssistant: {pair[1]}\n\n"
24
+
25
  if instruction:
26
  instruction = (
27
  instruction.strip()
 
207
  return "", history + [[message, None]]
208
 
209
  def respond(history=None):
210
+ global token_count_chat, temperature_chat, top_p_chat, presence_penalty_chat, count_penalty_chat
211
 
212
  # get the lastest user message and the additional parameters
213
+ instruction = history[-1][0]
 
 
 
214
  token_count = token_count_chat.value
215
 
216
  temperature = temperature_chat.value