Skip to content

Code for a .bat file to auto start Alpaca in Windows Terminal #661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
e750735
first commit
antimatter15 Mar 16, 2023
6d973a6
Fix CMake
anzz1 Mar 16, 2023
c8917ca
Fix Windows CI and autorelease
anzz1 Mar 16, 2023
0660aee
process the scanf() output so Ubuntu 22 compiler doesn't error due to…
bigattichouse Mar 16, 2023
bf24462
Merge pull request #5 from anzz1/master
antimatter15 Mar 17, 2023
2af2331
Merge pull request #3 from bigattichouse/master
antimatter15 Mar 17, 2023
72f9fbe
Fix #2
antimatter15 Mar 17, 2023
235a411
Update build.yml
antimatter15 Mar 17, 2023
f2eda96
Fix Makefile
anzz1 Mar 17, 2023
8a3d6f2
CI: Enable Linux/MacOS builds
anzz1 Mar 17, 2023
376a4a2
Merge branch 'master' into ci_test
anzz1 Mar 17, 2023
5be098f
Compute remaining tokens along the way and exit if over
jxy Mar 17, 2023
af02c94
add easy Windows install instructions to the readme
mcmonkey4eva Mar 17, 2023
197df5f
Merge pull request #18 from jxy/limit_tokens
antimatter15 Mar 17, 2023
71d0978
Merge pull request #12 from anzz1/ci_test
antimatter15 Mar 17, 2023
1e82fa8
Merge pull request #26 from mcmonkey4eva/master
antimatter15 Mar 17, 2023
e7bdee6
CI fine tuning
anzz1 Mar 17, 2023
d0f855a
Update README.md
antimatter15 Mar 17, 2023
7cd84a7
Update README.md
antimatter15 Mar 18, 2023
97d327e
Update chat.cpp
antimatter15 Mar 18, 2023
96e0519
extending context window
antimatter15 Mar 18, 2023
7b24407
Merge pull request #31 from anzz1/ci_test
antimatter15 Mar 18, 2023
e95e64b
Implement non-greedy tokenizer that tries to maximize token lengths (…
thement Mar 17, 2023
1cb9215
removing random prompt generation
antimatter15 Mar 18, 2023
501a8e1
adding to credit section
antimatter15 Mar 18, 2023
7e12661
ci releases for mac and linux
antimatter15 Mar 18, 2023
1c62e35
create release
antimatter15 Mar 18, 2023
3f7d187
more copying stuff
antimatter15 Mar 18, 2023
564b861
archiving artifacts
antimatter15 Mar 18, 2023
ddc4e24
maybe macos-arm64 is case sensitive
antimatter15 Mar 18, 2023
4a524c5
commenting out aarch
antimatter15 Mar 18, 2023
a83e2e7
Windows console ANSI color issue fixed
rupeshs Mar 18, 2023
bb60fda
Update command for downloading the weights to use `curl`
MariusCiocanel Mar 18, 2023
8bb0dd5
Merge pull request #1 from MariusCiocanel/MariusCiocanel-curl-instead…
MariusCiocanel Mar 18, 2023
b64ca1c
Merge pull request #40 from rupeshs/windows-console-ansi-color-fix
antimatter15 Mar 18, 2023
c0e1cb5
🙈 Add output `chat` to `.gitignore`
NatoBoram Mar 18, 2023
f69062f
Do the windows ANSI color fix properly
anzz1 Mar 18, 2023
1b19586
Init the var too
anzz1 Mar 18, 2023
60c84e6
Merge pull request #54 from NatoBoram/feature/gitignore-chat
antimatter15 Mar 18, 2023
ad0f01b
Merge pull request #56 from anzz1/patch-2
antimatter15 Mar 18, 2023
3a208b9
Merge pull request #42 from MariusCiocanel/master
antimatter15 Mar 18, 2023
e83984f
add cached torrent links
anzz1 Mar 20, 2023
2cbe796
Merge pull request #76 from anzz1/patch-3
antimatter15 Mar 20, 2023
99f3908
Automatically Generate Releases for Mac, Linux, Windows (#81)
antimatter15 Mar 20, 2023
7636ddb
Update README.md
antimatter15 Mar 21, 2023
428aa70
Add support for 30B model and 65B, if it is made in the future (#104)
ItsPi3141 Mar 21, 2023
9116ae9
Change argument processing to allow prompt or file args. (#103)
Tindell Mar 21, 2023
285ca17
Update README.md
antimatter15 Mar 21, 2023
81bd894
Update chat.cpp
antimatter15 Mar 21, 2023
c5ae5d0
Added support for 30B weight. (#108)
trevtravtrev Mar 21, 2023
3e481d0
Update README.md
antimatter15 Mar 23, 2023
6041736
Update README.md
antimatter15 Mar 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
337 changes: 142 additions & 195 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,241 +1,188 @@
name: CI
on: [push, pull_request]

on:
workflow_dispatch: # allows manual triggering
inputs:
create_release:
description: 'Create new release'
required: true
type: boolean
push:
paths: ['.github/workflows/**', 'CMakeLists.txt', 'Makefile', '**.h', '*.c', '**.cpp']
pull_request:
types: [opened, synchronize, edited, reopened, review_requested, ready_for_review]
paths: ['CMakeLists.txt', 'Makefile', '**.h', '*.c', '**.cpp']

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
ubuntu-latest:
runs-on: ubuntu-latest

steps:
- name: Clone
id: checkout
uses: actions/checkout@v1

- name: Dependencies
id: depends
run: |
sudo apt-get update
sudo apt-get install build-essential

- name: Build
id: make_build
run: |
make

macOS-latest:
- name: Zip executables
run: zip alpaca-linux.zip chat

- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: linux
path: |
alpaca-linux.zip


macos-latest:
runs-on: macOS-latest

steps:
- name: Clone
id: checkout
uses: actions/checkout@v1

- name: Dependencies
id: depends
run: |
brew update

- name: Build
id: make_build
run: |
make
make chat_mac

- name: Codesign executable
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
env:
MACOS_CERTIFICATE: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
MACOS_CERTIFICATE_PWD: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
KEYCHAIN_PWD: ${{ secrets.KEYCHAIN_PASSWORD }}
MACOS_CERT_ID: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_ID }}

run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p $KEYCHAIN_PWD build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p $KEYCHAIN_PWD build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PWD build.keychain
/usr/bin/codesign --options runtime --force -s $MACOS_CERT_ID ./chat_mac -v

- name: Zip executables
run: zip alpaca-mac.zip chat_mac

- name: Notarize executables
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
env:
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.AC_USERNAME }}
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.AC_PASSWORD }}
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
run: |
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD"
xcrun notarytool submit "alpaca-mac.zip" --keychain-profile "notarytool-profile" --wait

- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: macos
path: |
alpaca-mac.zip


windows-latest:
runs-on: windows-latest

steps:
- name: Clone
id: checkout
uses: actions/checkout@v1

- name: Build
id: cmake_build
run: |
mkdir build
cd build
cmake ..
cmake --build . --config Release

# ubuntu-latest-gcc:
# runs-on: ubuntu-latest
#
# strategy:
# matrix:
# build: [Debug, Release]
#
# steps:
# - name: Clone
# uses: actions/checkout@v1
#
# - name: Dependencies
# run: |
# sudo apt-get update
# sudo apt-get install build-essential
# sudo apt-get install cmake
#
# - name: Configure
# run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
#
# - name: Build
# run: |
# make
#
# ubuntu-latest-clang:
# runs-on: ubuntu-latest
#
# strategy:
# matrix:
# build: [Debug, Release]
#
# steps:
# - name: Clone
# uses: actions/checkout@v1
#
# - name: Dependencies
# run: |
# sudo apt-get update
# sudo apt-get install build-essential
# sudo apt-get install cmake
#
# - name: Configure
# run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
#
# - name: Build
# run: |
# make
#
# ubuntu-latest-gcc-sanitized:
# runs-on: ubuntu-latest
#
# strategy:
# matrix:
# sanitizer: [ADDRESS, THREAD, UNDEFINED]
#
# steps:
# - name: Clone
# uses: actions/checkout@v1
#
# - name: Dependencies
# run: |
# sudo apt-get update
# sudo apt-get install build-essential
# sudo apt-get install cmake
#
# - name: Configure
# run: cmake . -DCMAKE_BUILD_TYPE=Debug -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON
#
# - name: Build
# run: |
# make
#
# windows:
# runs-on: windows-latest
#
# strategy:
# matrix:
# build: [Release]
# arch: [Win32, x64]
# include:
# - arch: Win32
# s2arc: x86
# - arch: x64
# s2arc: x64
#
# steps:
# - name: Clone
# uses: actions/checkout@v1
#
# - name: Add msbuild to PATH
# uses: microsoft/setup-msbuild@v1
#
# - name: Configure
# run: >
# cmake -S . -B ./build -A ${{ matrix.arch }}
# -DCMAKE_BUILD_TYPE=${{ matrix.build }}
#
# - name: Build
# run: |
# cd ./build
# msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
#
# - name: Upload binaries
# uses: actions/upload-artifact@v1
# with:
# name: llama-bin-${{ matrix.arch }}
# path: build/bin/${{ matrix.build }}
#
# windows-blas:
# runs-on: windows-latest
#
# strategy:
# matrix:
# build: [Release]
# arch: [Win32, x64]
# blas: [ON]
# include:
# - arch: Win32
# obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x86.zip
# s2arc: x86
# - arch: x64
# obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip
# s2arc: x64
#
# steps:
# - name: Clone
# uses: actions/checkout@v1
#
# - name: Add msbuild to PATH
# uses: microsoft/setup-msbuild@v1
#
# - name: Fetch OpenBLAS
# if: matrix.blas == 'ON'
# run: |
# C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }}
# 7z x blas.zip -oblas -y
# copy blas/include/cblas.h .
# copy blas/include/openblas_config.h .
# echo "blasdir=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV
#
# - name: Configure
# run: >
# cmake -S . -B ./build -A ${{ matrix.arch }}
# -DCMAKE_BUILD_TYPE=${{ matrix.build }}
# -DLLAMA_SUPPORT_OPENBLAS=${{ matrix.blas }}
# -DCMAKE_LIBRARY_PATH="$env:blasdir/lib"
#
# - name: Build
# run: |
# cd ./build
# msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
#
# - name: Copy libopenblas.dll
# if: matrix.blas == 'ON'
# run: copy "$env:blasdir/bin/libopenblas.dll" build/bin/${{ matrix.build }}
#
# - name: Upload binaries
# if: matrix.blas == 'ON'
# uses: actions/upload-artifact@v1
# with:
# name: llama-blas-bin-${{ matrix.arch }}
# path: build/bin/${{ matrix.build }}
#
# emscripten:
# runs-on: ubuntu-latest
#
# strategy:
# matrix:
# build: [Release]
#
# steps:
# - name: Clone
# uses: actions/checkout@v1
#
# - name: Dependencies
# run: |
# wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
# tar -xvf master.tar.gz
# emsdk-master/emsdk update
# emsdk-master/emsdk install latest
# emsdk-master/emsdk activate latest
#
# - name: Configure
# run: echo "tmp"
#
# - name: Build
# run: |
# pushd emsdk-master
# source ./emsdk_env.sh
# popd
# emcmake cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
# make
- name: Pack artifacts
id: pack_artifacts
run: |
7z a alpaca-win.zip .\build\Release\*

- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: windows
path: |
alpaca-win.zip


release:
runs-on: ubuntu-latest
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
needs:
- windows-latest
- macos-latest
- ubuntu-latest

steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3

- name: Set commit hash variables
id: commit
uses: pr-mpt/actions-commit-hash@v2

- name: Create release
id: create_release
uses: zendesk/action-create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.commit.outputs.short }}

- name: Upload windows release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: windows/alpaca-win.zip
asset_name: alpaca-win.zip
asset_content_type: application/octet-stream

- name: Upload mac release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: macos/alpaca-mac.zip
asset_name: alpaca-mac.zip
asset_content_type: application/octet-stream

- name: Upload linux release

uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: linux/alpaca-linux.zip
asset_name: alpaca-linux.zip
asset_content_type: application/octet-stream
Loading