Tonic commited on
Commit
10b4b34
1 Parent(s): 4faaa57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -34,7 +34,7 @@ class ChatBot:
34
  user_input_ids = tokenizer.encode(input + tokenizer.eos_token, return_tensors="pt")
35
 
36
  # Concatenate the user input with chat history
37
- if self.history.numel() > 0:
38
  chat_history_ids = torch.cat([self.history, user_input_ids], dim=-1)
39
  else:
40
  chat_history_ids = user_input_ids
 
34
  user_input_ids = tokenizer.encode(input + tokenizer.eos_token, return_tensors="pt")
35
 
36
  # Concatenate the user input with chat history
37
+ if len(self.history) > 0:
38
  chat_history_ids = torch.cat([self.history, user_input_ids], dim=-1)
39
  else:
40
  chat_history_ids = user_input_ids