catherinesyeh / attention-viz

Visualizing query-key interactions in language + vision transformers
http://attentionviz.com/
MIT License
122 stars 15 forks source link

ERROR Cannot read properties of undefined (reading 'position') #71

Closed dbl001 closed 1 year ago

dbl001 commented 1 year ago

MacOS 14.0

% npm version                       
{
  'attention-viz': '0.1.0',
  npm: '9.7.1',
  node: '16.20.2',
  v8: '9.4.146.26-node.26',
  uv: '1.43.0',
  zlib: '1.3',
  brotli: '1.0.9',
  ares: '1.19.1',
  modules: '93',
  nghttp2: '1.47.0',
  napi: '8',
  llhttp: '6.0.11',
  openssl: '1.1.1w',
  cldr: '43.1',
  icu: '73.2',
  tz: '2023c',
  unicode: '15.0'
}

I get this exception occasionally ...

Uncaught runtime errors:
×
ERROR
Cannot read properties of undefined (reading 'position')
TypeError: Cannot read properties of undefined (reading 'position')
    at getMsg (webpack-internal:///./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-41.use[1]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/Projection/MatrixView/MatrixView.vue?vue&type=script&lang=ts:761:30)
    at Object.getTooltip (webpack-internal:///./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-41.use[1]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/Projection/MatrixView/MatrixView.vue?vue&type=script&lang=ts:775:63)
    at Deck._pickAndCallback (webpack-internal:///./node_modules/@deck.gl/core/dist/esm/lib/deck.js:629:40)
    at Deck._onRenderFrame (webpack-internal:///./node_modules/@deck.gl/core/dist/esm/lib/deck.js:758:10)
    at AnimationLoop.onRender (webpack-internal:///./node_modules/@luma.gl/engine/dist/esm/lib/animation-loop.js:243:23)
    at AnimationLoop._renderFrame (webpack-internal:///./node_modules/@luma.gl/engine/dist/esm/lib/animation-loop.js:333:10)
    at AnimationLoop.redraw (webpack-internal:///./node_modules/@luma.gl/engine/dist/esm/lib/animation-loop.js:168:10)
    at renderFrame (webpack-internal:///./node_modules/@luma.gl/engine/dist/esm/lib/animation-loop.js:267:12)

I can reproduce this by selecting either 'BERT' or 'GPT-2' as the model in MatrixView, then clicking on a head to get to SingleView.

dbl001 commented 1 year ago

Upgrading the front-end to:

npm@10.2.3 
Node.js v18.18.2

appears to have resolved the issue.