From 33e35b8fe8f09adcac0632e9cece62e1dd629f7d Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Sun, 26 Mar 2023 07:25:46 +0200 Subject: [PATCH 1/2] Exit from interactive mode if input stream is bad (#491) Allow exiting the interactive prompt also with CTRL-D on Unix and CTRL-Z on Windows. --- examples/main/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 9af8a7405..e9478d541 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -450,7 +450,10 @@ int main(int argc, char ** argv) { std::string line; bool another_line = true; do { - std::getline(std::cin, line); + if (!std::getline(std::cin, line)) { + // input stream is bad or EOF received + return 0; + } if (line.empty() || line.back() != '\\') { another_line = false; } else { From 348d6926ee31d4476f9b90e1a627b0925a70f847 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sun, 26 Mar 2023 10:20:49 +0300 Subject: [PATCH 2/2] Add logo to README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9ba6241da..86dd9493b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # llama.cpp +![llama](https://user-images.githubusercontent.com/1991296/227761327-6d83e30e-2200-41a6-bfbb-f575231c54f4.png) + [![Actions Status](https://github.com/ggerganov/llama.cpp/workflows/CI/badge.svg)](https://github.com/ggerganov/llama.cpp/actions) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)