From 0660aeed69f81601f31b29c36d300a9e6e6276f6 Mon Sep 17 00:00:00 2001 From: "Michael E. Johnson" Date: Thu, 16 Mar 2023 16:18:12 -0500 Subject: [PATCH 1/3] process the scanf() output so Ubuntu 22 compiler doesn't error due to default warn_unused_result instead of Makefile -Wunused-result --- chat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat.cpp b/chat.cpp index f72ad14f3..885d1f69a 100644 --- a/chat.cpp +++ b/chat.cpp @@ -1035,7 +1035,7 @@ int main(int argc, char ** argv) { if(params.use_color) printf(ANSI_BOLD ANSI_COLOR_GREEN); if (scanf("%255[^\n]%n%*c", buf, &n_read) <= 0) { // presumable empty line, consume the newline - scanf("%*c"); + if (scanf("%*c") <= 0) { /*ignore*/ } n_read=0; } if(params.use_color) printf(ANSI_COLOR_RESET); From 72f9fbe4d1338d322da6b3b5863ad7795ffb3d17 Mon Sep 17 00:00:00 2001 From: Kevin Kwok Date: Thu, 16 Mar 2023 18:36:09 -0700 Subject: [PATCH 2/3] Fix #2 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index db89f9709..14b294f1a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Run a fast ChatGPT-like model locally on your device. The screencast below is no [![asciicast](screencast.gif)](https://asciinema.org/a/dfJ8QXZ4u978Ona59LPEldtKK) -This combines the [LLaMA foundation model](https://github.com/facebookresearch/llama) with an [open reproduction](https://github.com/tloen/alpaca-lora) of [Stanford Alpaca](https://github.com/tatsu-lab/stanford_alpaca) a fine-tuning of the base model to obey instructions (akin to the [RLHF](https://huggingface.co/blog/rlhf) used to train ChatGPT). +This combines the [LLaMA foundation model](https://github.com/facebookresearch/llama) with an [open reproduction](https://github.com/tloen/alpaca-lora) of [Stanford Alpaca](https://github.com/tatsu-lab/stanford_alpaca) a fine-tuning of the base model to obey instructions (akin to the [RLHF](https://huggingface.co/blog/rlhf) used to train ChatGPT) and a set of modifications to [llama.cpp](https://github.com/ggerganov/llama.cpp) to add a chat interface. ## Get started @@ -18,7 +18,7 @@ make chat ./chat ``` -You can download the weights for `ggml-alpaca-7b-14.bin` with BitTorrent `magnet:?xt=urn:btih:5aaceaec63b03e51a98f04fd5c42320b2a033010&dn=ggml-alpaca-7b-q4.bin&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Fopentracker.i2p.rocks%3A6969%2Fannounce` +You can download the weights for `ggml-alpaca-7b-q4.bin` with BitTorrent `magnet:?xt=urn:btih:5aaceaec63b03e51a98f04fd5c42320b2a033010&dn=ggml-alpaca-7b-q4.bin&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Fopentracker.i2p.rocks%3A6969%2Fannounce` Alternatively you can download them with IPFS. @@ -30,13 +30,13 @@ wget -O ggml-alpaca-7b-q4.bin -c https://ipfs.io/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2 wget -O ggml-alpaca-7b-q4.bin -c https://cloudflare-ipfs.com/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC ``` -Save the `ggml-alpaca-7b-14.bin` file in the same directory as your `./chat` executable. +Save the `ggml-alpaca-7b-q4.bin` file in the same directory as your `./chat` executable. The weights are based on the published fine-tunes from `alpaca-lora`, converted back into a pytorch checkpoint with a [modified script](https://github.com/tloen/alpaca-lora/pull/19) and then quantized with llama.cpp the regular way. ## Credit -This combines [Facebook's LLaMA](https://github.com/facebookresearch/llama), [Stanford Alpaca](https://crfm.stanford.edu/2023/03/13/alpaca.html), [alpaca-lora](https://github.com/tatsu-lab/stanford_alpaca) (which uses [Jason Phang's implementation of LLaMA](https://github.com/huggingface/transformers/pull/21955) on top of Hugging Face Transformers), and a modified version of [llama.cpp](https://github.com/ggerganov/llama.cpp) by Georgi Gerganov. The chat implementation is based on Matvey Soloviev's [Interactive Mode](https://github.com/ggerganov/llama.cpp/pull/61) for llama.cpp. Inspired by [Simon Willison's](https://til.simonwillison.net/llms/llama-7b-m2) getting started guide for LLaMA. +This combines [Facebook's LLaMA](https://github.com/facebookresearch/llama), [Stanford Alpaca](https://crfm.stanford.edu/2023/03/13/alpaca.html), [alpaca-lora](https://github.com/tloen/alpaca-lora) and [corresponding weights](https://huggingface.co/tloen/alpaca-lora-7b/tree/main) by Eric Wang (which uses [Jason Phang's implementation of LLaMA](https://github.com/huggingface/transformers/pull/21955) on top of Hugging Face Transformers), and [llama.cpp](https://github.com/ggerganov/llama.cpp) by Georgi Gerganov. The chat implementation is based on Matvey Soloviev's [Interactive Mode](https://github.com/ggerganov/llama.cpp/pull/61) for llama.cpp. Inspired by [Simon Willison's](https://til.simonwillison.net/llms/llama-7b-m2) getting started guide for LLaMA. ## Disclaimer From 235a4115dfe50c63a0290ffb6c70719c9a9341ee Mon Sep 17 00:00:00 2001 From: Kevin Kwok Date: Thu, 16 Mar 2023 18:39:41 -0700 Subject: [PATCH 3/3] Update build.yml --- .github/workflows/build.yml | 62 ++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59aac6314..b6140ab13 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,37 +14,37 @@ on: paths: ['CMakeLists.txt', 'Makefile', '**.h', '*.c', '**.cpp'] jobs: -# ubuntu-latest: -# runs-on: ubuntu-latest -# -# steps: -# - name: Clone -# uses: actions/checkout@v1 -# -# - name: Dependencies -# run: | -# sudo apt-get update -# sudo apt-get install build-essential -# -# - name: Build -# run: | -# make -# -# macOS-latest: -# runs-on: macOS-latest -# -# steps: -# - name: Clone -# uses: actions/checkout@v1 -# -# - name: Dependencies -# run: | -# brew update -# -# - name: Build -# run: | -# make -# + ubuntu-latest: + runs-on: ubuntu-latest + + steps: + - name: Clone + uses: actions/checkout@v1 + + - name: Dependencies + run: | + sudo apt-get update + sudo apt-get install build-essential + + - name: Build + run: | + make + + macOS-latest: + runs-on: macOS-latest + + steps: + - name: Clone + uses: actions/checkout@v1 + + - name: Dependencies + run: | + brew update + + - name: Build + run: | + make + windows-latest: runs-on: windows-latest