botisan-ai / gpt3-tokenizer

Isomorphic JavaScript/TypeScript Tokenizer for GPT-3 and Codex Models by OpenAI.
MIT License
171 stars 19 forks source link

Issues module constructor #10

Closed react-universe closed 1 year ago

react-universe commented 1 year ago

I am getting this error after implementation TypeError: gpt3_tokenizer__WEBPACK_IMPORTED_MODULE_3__.GPT3Tokenizer is not a constructor

raphaelrk commented 1 year ago

Try

import GPT3Tokenizer from 'gpt3-tokenizer';

instead of

import { GPT3Tokenizer } from 'gpt3-tokenizer';
lhr0909 commented 1 year ago

Just checked the entry point of the code and it is in fact a default import. Will update the README soon!