mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 19:06:11 +00:00
Do not let a shrugging sysconf turn a workstation into a tiny machine
Three from the review of the change before this one. sysconf answers -1 for a limit it holds to be indeterminate, and CPython hands that back rather than raising, so the page count times the page size came out negative. A negative is truthy, so it went past the check for a machine nothing could be read from and floored at half a gigabyte: a 64 GB workstation was told every model past 512 MB was too big for it, the suggestion dropped to small-q5_1, and the machine line read "Memory: -4096 B". Anything not positive is now the unknown machine it always was. The memory is read once and kept. It does not change while Dikte runs, and a thirty row list asked seventy times per draw, which on the Mac path is seventy processes started on the interface thread every time a download finished, a model was deleted or a publisher changed. And "test-" is matched as a plain substring, so it was also inside "Latest-" and dropped a publisher nothing is wrong with. Anchored the way every other mark in that list already is.
This commit is contained in:
@@ -24,6 +24,7 @@ from unittest import mock
|
||||
|
||||
from dikte import assistant
|
||||
from dikte import config as cfg
|
||||
from dikte import ggml
|
||||
from dikte import i18n
|
||||
from dikte import update
|
||||
|
||||
@@ -95,6 +96,10 @@ class DikteTest(unittest.TestCase):
|
||||
i18n.set_language("en")
|
||||
self.addCleanup(i18n.set_language, "en")
|
||||
|
||||
# Read once and kept for the life of the process, which across a test
|
||||
# run means one test's machine answering for the next one's.
|
||||
self.patch_attr(ggml, "_MEMORY", None)
|
||||
|
||||
# cli.launch_gui replaces this process with the application when no
|
||||
# instance is running. A test that reaches it would take the whole run
|
||||
# with it and hang, so it fails loudly here instead.
|
||||
|
||||
Reference in New Issue
Block a user