File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Original file line number Diff line number Diff line change @@ -831,9 +831,7 @@ def _create_completion(
831
831
"logprobs is not supported for models created with logits_all=False"
832
832
)
833
833
834
- # Temporarily disable usage of the cache
835
- # See: https://github.com/abetlen/llama-cpp-python/issues/348#issuecomment-1583072408
836
- if self .cache and False :
834
+ if self .cache :
837
835
try :
838
836
cache_item = self .cache [prompt_tokens ]
839
837
cache_prefix_len = Llama .longest_token_prefix (
@@ -1071,14 +1069,14 @@ def _create_completion(
1071
1069
}
1072
1070
],
1073
1071
}
1074
- if self .cache and False :
1072
+ if self .cache :
1075
1073
if self .verbose :
1076
1074
print ("Llama._create_completion: cache save" , file = sys .stderr )
1077
1075
self .cache [prompt_tokens + completion_tokens ] = self .save_state ()
1078
1076
print ("Llama._create_completion: cache saved" , file = sys .stderr )
1079
1077
return
1080
1078
1081
- if self .cache and False :
1079
+ if self .cache :
1082
1080
if self .verbose :
1083
1081
print ("Llama._create_completion: cache save" , file = sys .stderr )
1084
1082
self .cache [prompt_tokens + completion_tokens ] = self .save_state ()
You can’t perform that action at this time.
0 commit comments