Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Ragna UI does not display chat information, creates console errors #219

Closed
Tengal-Teemo opened this issue Nov 29, 2023 · 2 comments · Fixed by #220
Closed

[BUG] - Ragna UI does not display chat information, creates console errors #219

Tengal-Teemo opened this issue Nov 29, 2023 · 2 comments · Fixed by #220
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@Tengal-Teemo
Copy link
Contributor

Bug description

Clicking the below button on a created chat in Ragna UI does not display chat information
image
Additionally, the following error logs are generated in console

ERROR:bokeh.server.protocol_handler:error handling message
 message: Message 'PATCH-DOC' content: {'events': [{'kind': 'MessageSent', 'msg_type': 'bokeh_event', 'msg_data': {'type': 'event', 'name': 'button_click', 'values': {'type': 'map', 'entries': [['model', {'id': 'p1632'}]]}}}]} 
 error: KeyError('chunk_size')
Traceback (most recent call last):
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/server/protocol_handler.py", line 97, in handle
    work = await handler(message, connection)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/server/session.py", line 94, in _needs_document_lock_wrapper
    result = func(self, *args, **kwargs)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/server/session.py", line 286, in _handle_patch
    message.apply_to_document(self.document, self)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/protocol/messages/patch_doc.py", line 104, in apply_to_document
    invoke_with_curdoc(doc, lambda: doc.apply_json_patch(self.payload, setter=setter))
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/callbacks.py", line 443, in invoke_with_curdoc
    return f()
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/protocol/messages/patch_doc.py", line 104, in <lambda>
    invoke_with_curdoc(doc, lambda: doc.apply_json_patch(self.payload, setter=setter))
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/document.py", line 391, in apply_json_patch
    DocumentPatchedEvent.handle_event(self, event, setter)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/events.py", line 245, in handle_event
    event_cls._handle_event(doc, event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/events.py", line 280, in _handle_event
    cb(event.msg_data)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/callbacks.py", line 390, in trigger_event
    model._trigger_event(event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/util/callback_manager.py", line 113, in _trigger_event
    self.document.callbacks.notify_event(cast(Model, self), event, invoke)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/callbacks.py", line 260, in notify_event
    invoke_with_curdoc(doc, callback_invoker)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/callbacks.py", line 443, in invoke_with_curdoc
    return f()
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/util/callback_manager.py", line 109, in invoke
    cast(EventCallbackWithEvent, callback)(event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/panel/reactive.py", line 494, in _server_event
    self._comm_event(doc, event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/panel/reactive.py", line 481, in _comm_event
    state._handle_exception(e)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/panel/io/state.py", line 440, in _handle_exception
    raise exception
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/panel/reactive.py", line 479, in _comm_event
    self._process_bokeh_event(doc, event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/panel/reactive.py", line 416, in _process_bokeh_event
    self._process_event(event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/panel/widgets/button.py", line 247, in _process_event
    self.clicks += 1
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameterized.py", line 525, in _f
    instance_param.__set__(obj, val)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameterized.py", line 527, in _f
    return f(self, obj, val)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameters.py", line 542, in __set__
    super().__set__(obj,val)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameterized.py", line 527, in _f
    return f(self, obj, val)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameterized.py", line 1545, in __set__
    obj.param._call_watcher(watcher, event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameterized.py", line 2486, in _call_watcher
    self_._execute_watcher(watcher, (event,))
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameterized.py", line 2468, in _execute_watcher
    watcher.fn(*args, **kwargs)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/ragna/_ui/central_view.py", line 259, in on_click_chat_info_wrapper
    "Chunk size": self.current_chat["metadata"]["params"]["chunk_size"],
KeyError: 'chunk_size'

How to reproduce the bug?

  1. Install Ragna as per the instructions on the docs
  2. Run ragna init, testing shows the configuration does not affect this bug
  3. Run ragna ui and connect to localhost:port
  4. Login, create chat with an assistant and database store, and click the information button top right
  5. View the console logs

Versions and dependencies used

  • Ragna version: v0.1.1
  • Ragna git commit hash: 3d8541f15ca187b6ef01d49e40db8f33fc9d7ec4 (tags/v0.1.1)
  • Python version: 3.10.12
  • OS: Linux Mint 21.2 (Victoria)

Anything else?

If using a vector database like chromadb a slightly different error is created.

ERROR:bokeh.server.protocol_handler:error handling message
 message: Message 'PATCH-DOC' content: {'events': [{'kind': 'MessageSent', 'msg_type': 'bokeh_event', 'msg_data': {'type': 'event', 'name': 'button_click', 'values': {'type': 'map', 'entries': [['model', {'id': 'p1810'}]]}}}]} 
 error: KeyError('max_new_tokens')
Traceback (most recent call last):
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/server/protocol_handler.py", line 97, in handle
    work = await handler(message, connection)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/server/session.py", line 94, in _needs_document_lock_wrapper
    result = func(self, *args, **kwargs)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/server/session.py", line 286, in _handle_patch
    message.apply_to_document(self.document, self)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/protocol/messages/patch_doc.py", line 104, in apply_to_document
    invoke_with_curdoc(doc, lambda: doc.apply_json_patch(self.payload, setter=setter))
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/callbacks.py", line 443, in invoke_with_curdoc
    return f()
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/protocol/messages/patch_doc.py", line 104, in <lambda>
    invoke_with_curdoc(doc, lambda: doc.apply_json_patch(self.payload, setter=setter))
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/document.py", line 391, in apply_json_patch
    DocumentPatchedEvent.handle_event(self, event, setter)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/events.py", line 245, in handle_event
    event_cls._handle_event(doc, event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/events.py", line 280, in _handle_event
    cb(event.msg_data)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/callbacks.py", line 390, in trigger_event
    model._trigger_event(event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/util/callback_manager.py", line 113, in _trigger_event
    self.document.callbacks.notify_event(cast(Model, self), event, invoke)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/callbacks.py", line 260, in notify_event
    invoke_with_curdoc(doc, callback_invoker)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/document/callbacks.py", line 443, in invoke_with_curdoc
    return f()
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/bokeh/util/callback_manager.py", line 109, in invoke
    cast(EventCallbackWithEvent, callback)(event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/panel/reactive.py", line 494, in _server_event
    self._comm_event(doc, event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/panel/reactive.py", line 481, in _comm_event
    state._handle_exception(e)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/panel/io/state.py", line 440, in _handle_exception
    raise exception
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/panel/reactive.py", line 479, in _comm_event
    self._process_bokeh_event(doc, event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/panel/reactive.py", line 416, in _process_bokeh_event
    self._process_event(event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/panel/widgets/button.py", line 247, in _process_event
    self.clicks += 1
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameterized.py", line 525, in _f
    instance_param.__set__(obj, val)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameterized.py", line 527, in _f
    return f(self, obj, val)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameters.py", line 542, in __set__
    super().__set__(obj,val)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameterized.py", line 527, in _f
    return f(self, obj, val)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameterized.py", line 1545, in __set__
    obj.param._call_watcher(watcher, event)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameterized.py", line 2486, in _call_watcher
    self_._execute_watcher(watcher, (event,))
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/param/parameterized.py", line 2468, in _execute_watcher
    watcher.fn(*args, **kwargs)
  File "/home/tazukiswift/.local/lib/python3.10/site-packages/ragna/_ui/central_view.py", line 266, in on_click_chat_info_wrapper
    "Max new tokens": self.current_chat["metadata"]["params"][
KeyError: 'max_new_tokens'
@Tengal-Teemo Tengal-Teemo added the type: bug 🐛 Something isn't working label Nov 29, 2023
@pmeier
Copy link
Member

pmeier commented Nov 29, 2023

Thanks for the report @Tengal-Teemo! Can reproduce on main.

@pmeier pmeier self-assigned this Nov 29, 2023
@pmeier pmeier mentioned this issue Nov 30, 2023
@pmeier
Copy link
Member

pmeier commented Nov 30, 2023

This fix is available in the latest pre release. See #223.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants