Distribute and run LLMs with a single file.
C++ cross-platformggufllama-cpplocal-ailocal-inferencelocal-llmopen-source-aisingle-file-executablespeech-to-text
Import upstream bestline changes
Justine Tunney21af0bf02de5
diff --git a/llamafile/bestline.c b/llamafile/bestline.cindex 56e2b300..b5509066 100644--- a/llamafile/bestline.c+++ b/llamafile/bestline.c@@ -2029,6 +2029,10 @@ static ssize_t bestlineCompleteLine(struct bestlineState *ls, char *seq, int sizls->len = saved.len;ls->pos = saved.pos;ls->buf = saved.buf;+ if (lc.len == 1) {+ nread = 0;+ goto FinishQuickly;+ }} else {bestlineRefreshLine(ls);}@@ -2045,6 +2049,7 @@ static ssize_t bestlineCompleteLine(struct bestlineState *ls, char *seq, int sizbreak;default:if (i < lc.len) {+ FinishQuickly:n = strlen(lc.cvec[i]);if (bestlineGrow(ls, n + 1)) {memcpy(ls->buf, lc.cvec[i], n + 1);