ahmedheakl commited on
Commit
59fe2a0
·
verified ·
1 Parent(s): 7d288f7

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. gradio_app.py +2 -2
gradio_app.py CHANGED
@@ -54,11 +54,11 @@ def load_chat(
54
  history = history or start_message
55
  print(history)
56
  if len(history) > 0 and isinstance(history[0], (list, tuple)):
57
- history = history[:TOP_N_HISTORY]
58
  history = ChatInterface._tuples_to_messages(history)
59
  elif len(history) > 0 and isinstance(history[0], dict):
60
  history = history_to_messages(history)
61
- history = history[:TOP_N_HISTORY]
62
  files = message.get('files', [])
63
  content = [
64
  {"type": "text", "text": message.get('text', '')}
 
54
  history = history or start_message
55
  print(history)
56
  if len(history) > 0 and isinstance(history[0], (list, tuple)):
57
+ history = history[-TOP_N_HISTORY:]
58
  history = ChatInterface._tuples_to_messages(history)
59
  elif len(history) > 0 and isinstance(history[0], dict):
60
  history = history_to_messages(history)
61
+ history = history[-TOP_N_HISTORY:]
62
  files = message.get('files', [])
63
  content = [
64
  {"type": "text", "text": message.get('text', '')}