Skip to content

TypeError: bpe(...).split is not a function #8

@bramses

Description

@bramses

if token == toString the encoder errors out with this error.

https://github.com/latitudegames/GPT-3-Encoder/blob/master/Encoder.js#L163

Suggested fix: Cast token to string:

(toString).split(' ')
VM236:1 Uncaught TypeError: toString.split is not a function
    at <anonymous>:1:12
('toString').split(' ')
['toString']

EDIT:

same issue occured with constructor. The encoder may struggle with all reserved JS keywords :/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions