mirror of
https://github.com/p-e-w/heretic.git
synced 2026-11-06 05:16:39 +00:00
perf: disable KV cache when obtaining module I/O
This commit is contained in:
1 file changed
+9
-1
@@ -235,6 +235,10 @@ class Model:
|
||||
)
|
||||
],
|
||||
max_new_tokens=1,
|
||||
# The KV cache is deliberately left enabled here so we can
|
||||
# catch dtype errors related to the cache, which we will need
|
||||
# for generating responses.
|
||||
# use_cache=False,
|
||||
)
|
||||
except Exception as error:
|
||||
self.model = None
|
||||
@@ -855,7 +859,11 @@ class Model:
|
||||
)
|
||||
)
|
||||
|
||||
self.generate(prompts, max_new_tokens=1)
|
||||
self.generate(
|
||||
prompts,
|
||||
max_new_tokens=1,
|
||||
use_cache=False,
|
||||
)
|
||||
|
||||
for hook_handle in hook_handles:
|
||||
hook_handle.remove()
|
||||
|
||||
Reference in new issue
Block a user