You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @hans00, I'm testing your suggestions and your code example but somehow I always get JSON Parse error: Unexpected character issue on parsing downloaded model. I tried on simulator but I couldn't pass this error at all.
This is the code area on transformers.js that gives this error. (node_modules/@xenova/transformers/src/utils/hub.js)
For polyfills, I did something like this;
import'text-encoding-polyfill';// support TextEncoderimport{polyfillaspolyfillReadableStream}from'react-native-polyfill-globals/src/readable-stream';import{polyfillaspolyfillFetch}from'react-native-polyfill-globals/src/fetch';import{Buffer}from'buffer';importXRegExpfrom'xregexp';polyfillReadableStream();polyfillFetch();global.Buffer=Buffer;// replace default RegExp to support unicodeconstnativeRegExp=global.RegExp;constnewRegExp=(...args)=>{global.RegExp=nativeRegExp;constresult=XRegExp(...args);global.RegExp=newRegExp;returnresult;};global.RegExp=newRegExp;
I added fetch and readable stream because it didn't work if I don't add them. Do you have any clue why I keep getting this?
"@xenova/transformers": "^2.17.0"
It looks you installed the wrong version of transformers.
The PR of RN support have not merged.
So that you should install from source or pre-release
Hey @hans00, I'm testing your suggestions and your code example but somehow I always get
JSON Parse error: Unexpected character issue
on parsing downloaded model. I tried on simulator but I couldn't pass this error at all.This is the code area on transformers.js that gives this error. (
node_modules/@xenova/transformers/src/utils/hub.js
)For polyfills, I did something like this;
I added fetch and readable stream because it didn't work if I don't add them. Do you have any clue why I keep getting this?
package versions;
babel config
The text was updated successfully, but these errors were encountered: