File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -848,11 +848,6 @@ def _create_completion(
848
848
finish_reason = "length"
849
849
break
850
850
851
- if self .cache :
852
- if self .verbose :
853
- print ("Llama._create_completion: cache save" , file = sys .stderr )
854
- self .cache [prompt_tokens + completion_tokens ] = self .save_state ()
855
-
856
851
if self .verbose :
857
852
llama_cpp .llama_print_timings (self .ctx )
858
853
@@ -941,8 +936,17 @@ def _create_completion(
941
936
}
942
937
],
943
938
}
939
+ if self .cache :
940
+ if self .verbose :
941
+ print ("Llama._create_completion: cache save" , file = sys .stderr )
942
+ self .cache [prompt_tokens + completion_tokens ] = self .save_state ()
944
943
return
945
944
945
+ if self .cache :
946
+ if self .verbose :
947
+ print ("Llama._create_completion: cache save" , file = sys .stderr )
948
+ self .cache [prompt_tokens + completion_tokens ] = self .save_state ()
949
+
946
950
text_str = text .decode ("utf-8" , errors = "ignore" )
947
951
948
952
if echo :
You can’t perform that action at this time.
0 commit comments