Crash after prompting
Describe the bug
Sometimes but not always, alpaca crashes right after prompting.
Expected behavior
No crashing.
Screenshots
Not applicable, because the window disappears immediately.
Debugging information
flatpak run com.jeffser.Alpaca
INFO [main.py | main] Alpaca version: 7.5.2
MESA-INTEL: warning: ../src/intel/vulkan/anv_formats.c:873: FINISHME: support YUV colorspace with DRM format modifiers
MESA-INTEL: warning: ../src/intel/vulkan/anv_formats.c:905: FINISHME: support more multi-planar formats with DRM modifiers
INFO [_client.py | _send_single_request] HTTP Request: GET http://127.0.0.1:8080/v1/models "HTTP/1.1 200 OK"
INFO [_client.py | _send_single_request] HTTP Request: POST http://127.0.0.1:8080/v1/chat/completions "HTTP/1.1 200 OK"
INFO [_client.py | _send_single_request] HTTP Request: POST http://127.0.0.1:8080/v1/chat/completions "HTTP/1.1 200 OK"
**
Gtk:ERROR:../gtk/gtktextlinedisplaycache.c:196:gtk_text_line_display_cache_take_display: assertion failed: (g_hash_table_lookup (cache->line_to_display, display->line) == NULL)
Bail out! Gtk:ERROR:../gtk/gtktextlinedisplaycache.c:196:gtk_text_line_display_cache_take_display: assertion failed: (g_hash_table_lookup (cache->line_to_display, display->line) == NULL)
Hi thanks for the report, this is most likely produced by the main GTK thread not handling the updating of text gracefully.
I made some changes to how threading work during rendering of messages that might do the trick
https://github.com/Jeffser/Alpaca/commit/3d5024b811ccf3111c20ffe2f73f0ebc28fc2be0
Unfortunately, in 7.5.4, this still persists on a clean install (regenerating the message seems to be the most surefire way to do it):
Gtk:ERROR:../gtk/gtktextlinedisplaycache.c:196:gtk_text_line_display_cache_take_display: assertion failed: (g_hash_table_lookup (cache->line_to_display, display->line) == NULL)
Bail out! Gtk:ERROR:../gtk/gtktextlinedisplaycache.c:196:gtk_text_line_display_cache_take_display: assertion failed: (g_hash_table_lookup (cache->line_to_display, display->line) == NULL)
Same here. I can also get it to crash by running a model that isn't suffering from a bottleneck.
Other errors it throws when reproducing the issue include:
Gtk:ERROR:../gtk/gtktextlayout.c:2396:gtk_text_layout_create_display: code should not be reached
and
Gtk:ERROR:../gtk/gtktextview.c:6110:gtk_text_view_paint: code should not be reached
In addition to the error Ferenc and roland are getting. I'm not sure if my error messages are new or if they were happening in 7.5.2 since I kinda just followed my instinct to update first, but I figured better to weigh in with the errors I got than to assume it's unrelated.