try/catch Block Should Be Moved Inside Async Function in useEffect Hook
useEffect(() => {
setDownloadProgress(0);
setError(null);
if (!preventLoad) {
try {
(async () => {
await model.load({
modelSource,
tokenizerSource,
tokenizerConfigSource,
});
})();
} catch (e) {
setError(e);
}
}
return () => {
model.delete();
};
}, [modelSource, tokenizerSource, tokenizerConfigSource, preventLoad, model]);
try/catch Block Should Be Moved Inside Async Function in useEffect Hook