devve1 commited on
Commit
11c7a3d
1 Parent(s): 6e824ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -382,7 +382,7 @@ if __name__ == '__main__':
382
  if menu_id == 'Documents':
383
  editable_df = st.data_editor(
384
  st.session_state.df,
385
- num_rows="dynamic",
386
  use_container_width=True,
387
  column_config={
388
  "document": st.column_config.TextColumn(
@@ -417,7 +417,11 @@ if __name__ == '__main__':
417
  help='Either to enable or disable the ability for the ai to find this document',
418
  required=True,
419
  default=True
420
- )
 
 
 
 
421
  }
422
  )
423
  st.session_state.df = editable_df
@@ -447,6 +451,7 @@ if __name__ == '__main__':
447
  format_func=lambda x: conversations.get(x, 'New Chat' if x != st.session_state.chat_id else st.session_state.chat_title),
448
  placeholder='_',
449
  )
 
450
  st.session_state.chat_title = f'ChatSession-{st.session_state.chat_id}'
451
 
452
  chat_id_path = os.path.join(os.getenv('HF_HOME'), f'{st.session_state.chat_id}-st_messages')
@@ -469,6 +474,7 @@ if __name__ == '__main__':
469
 
470
  st.session_state.chat_id = outputs[0].outputs[0].text
471
  st.session_state.chat_title = f'ChatSession-{st.session_state.chat_id}'
 
472
 
473
  conversations[st.session_state.chat_id] = st.session_state.chat_title
474
  with lz4.frame.open(conversations_path, mode='wb') as fp:
 
382
  if menu_id == 'Documents':
383
  editable_df = st.data_editor(
384
  st.session_state.df,
385
+ num_rows="fixed",
386
  use_container_width=True,
387
  column_config={
388
  "document": st.column_config.TextColumn(
 
417
  help='Either to enable or disable the ability for the ai to find this document',
418
  required=True,
419
  default=True
420
+ ),
421
+ "delete": st.column_config.ImageColumn(
422
+ 'Delete',
423
+ help='Delete a document definitively ( you can still browse it and insert it again later )'
424
+ )
425
  }
426
  )
427
  st.session_state.df = editable_df
 
451
  format_func=lambda x: conversations.get(x, 'New Chat' if x != st.session_state.chat_id else st.session_state.chat_title),
452
  placeholder='_',
453
  )
454
+ print(f'Chat ID : {st.session_state.chat_id}')
455
  st.session_state.chat_title = f'ChatSession-{st.session_state.chat_id}'
456
 
457
  chat_id_path = os.path.join(os.getenv('HF_HOME'), f'{st.session_state.chat_id}-st_messages')
 
474
 
475
  st.session_state.chat_id = outputs[0].outputs[0].text
476
  st.session_state.chat_title = f'ChatSession-{st.session_state.chat_id}'
477
+ print(f'Chat Title : {st.session_state.chat_title}')
478
 
479
  conversations[st.session_state.chat_id] = st.session_state.chat_title
480
  with lz4.frame.open(conversations_path, mode='wb') as fp: