Trigger82 commited on
Commit
4062e29
Β·
verified Β·
1 Parent(s): 3fcb18f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -25,6 +25,9 @@ def enhance_response(resp, message):
25
  return " ".join(resp.split()[:15])
26
 
27
  def chat(user_input, history):
 
 
 
28
  context = format_context(history) + f"You: {user_input}\n𝕴 𝖆𝖒 π–π–Žπ–’:"
29
  inputs = tokenizer.encode(context, return_tensors="pt", truncation=True, max_length=1024)
30
 
 
25
  return " ".join(resp.split()[:15])
26
 
27
  def chat(user_input, history):
28
+ if history is None:
29
+ history = []
30
+
31
  context = format_context(history) + f"You: {user_input}\n𝕴 𝖆𝖒 π–π–Žπ–’:"
32
  inputs = tokenizer.encode(context, return_tensors="pt", truncation=True, max_length=1024)
33