]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
starcoder : detect santacoder fix end of text token (#155)
authorIGUILIZ Salah-Eddine <redacted>
Sun, 14 May 2023 15:31:08 +0000 (17:31 +0200)
committerGitHub <redacted>
Sun, 14 May 2023 15:31:08 +0000 (18:31 +0300)
Co-authored-by: IGUILIZ Salah-Eddine <redacted>
examples/starcoder/main.cpp

index d7a2d5ea3ad6816b381827627f5297e0985d4de3..a4608225d5269a6102f09d760aa631e8b0cdc8e5 100644 (file)
@@ -828,8 +828,12 @@ int main(int argc, char ** argv) {
         }
         fflush(stdout);
 
-        // end of text token
-        if (embd.back() == 0) { //TODO: this is only for starcoder
+        // check if model is santacoder
+        if (model.hparams.n_layer <= 30 && embd.back() == 49152) {
+            break;
+        }
+        // check if model is starcoder
+        else if (embd.back() == 0) { //TODO: this is only for starcoder
             break;
         }
     }