Explorar el Código

[main] fix infinite generation (-n == -1) (#523)

anzz1 hace 2 años
padre
commit
7a87d31f4f
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      examples/main/main.cpp

+ 1 - 1
examples/main/main.cpp

@@ -493,7 +493,7 @@ int main(int argc, char ** argv) {
         }
 
         // In interactive mode, respect the maximum number of tokens and drop back to user input when reached.
-        if (params.interactive && n_remain <= 0) {
+        if (params.interactive && n_remain <= 0 && params.n_predict != -1) {
             n_remain = params.n_predict;
             is_interacting = true;
         }