Skip to content
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

feat: function calling #139

Merged
merged 22 commits into from
Jan 19, 2024
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
3 changes: 2 additions & 1 deletion .config/typedoc.json
Original file line number Diff line number Diff line change
@@ -19,5 +19,6 @@
"useCodeBlocks": true,
"expandObjects": true,
"parametersFormat": "table",
"hideInPageTOC": true
"hideInPageTOC": true,
"docsRoot": "../docs"
}
54 changes: 52 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -176,16 +176,19 @@ jobs:
await $`mkdir -p llamaBins`;

for (const arch of arches) {
const additionalFlags = [];
let buildNodeVersion = nodeVersion;

if (process.env.ARTIFACT_NAME === "win" && arch === "arm64") {
buildNodeVersion = windowsOnArmNodeVersion;
} else if (process.env.ARTIFACT_NAME === "mac" && arch === "x64") {
additionalFlags.push("--no-metal");
}

console.log(`Building ${arch} for node ${buildNodeVersion}`);

const binName = `${process.env.ARTIFACT_NAME}-${arch}`;
await $`node ./dist/cli/cli.js build --arch ${arch} --nodeTarget ${buildNodeVersion}`;
const binName = `${process.env.ARTIFACT_NAME}-${arch}`;
await $`node ./dist/cli/cli.js build --arch ${arch} --nodeTarget ${buildNodeVersion} ${additionalFlags}`;
await $`mv ./llama/build/Release ${"./llamaBins/" + binName}`;
}

@@ -237,6 +240,53 @@ jobs:
- name: Run standalone tests
run: npm run test:standalone

model-dependent-tests:
name: Model dependent tests
runs-on: macos-13
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "20"

- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: build
path: dist

- name: Download llama.cpp artifact
uses: actions/download-artifact@v3
with:
name: llama.cpp
path: llama/llama.cpp

- name: Install dependencies on macOS
run: |
brew install cmake ninja
alias make=cmake

- name: Install modules
run: npm ci

- name: Build binary
run: node ./dist/cli/cli.js build

- name: Cache models
id: cache-test-models
uses: actions/cache@v3
with:
path: "test/.models/**.gguf"
key: cache-test-models-${{ runner.os }}-${{ github.workflow }}

- name: Download models or ensure all models are downloaded
run: npm run dev:setup:downloadAllTestModels

- name: Run model dependent tests
run: npm run test:modelDependent

release:
name: Release
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ node_modules
/.env
/.eslintcache
/.vitepress/.cache
/test/.models
/coverage

/llama/compile_commands.json
Loading