cztomsik / ggml-js

JavaScript bindings for the ggml-js library
MIT License
41 stars 1 forks source link

getting segmentation fault when running the basic example #3

Open capaj opened 1 year ago

capaj commented 1 year ago

I am getting

3
[1]    67813 segmentation fault  node test.mjs

I am running just the sample from the readme:

import { Context, F } from 'ggml-js/core'

// Create context, two 1D tensors and multiply them
const ctx = Context.init()
const a = ctx.newTensor1D('f32', 1)
const b = ctx.newTensor1D('f32', 1)
const ab = F.mul(a, b)

// Build the computation graph
const graph = ctx.buildForward(ab)

// Set values & compute the graph
a.set(0, 1.5)
b.set(0, 2)
graph.compute()

// Get result
console.log(ab.get(0))

using node.js 20.0.2, tried node 18 too. I am on mac OS 13.4

cztomsik commented 11 months ago

It's not published yet on npm but if you build it locally then this is already resolved