@@ -50,36 +50,36 @@ class _MainAppState extends State<MainApp> {
5050
5151 // DefaultAssetBundle.of(context).
5252
53- // final ByteData classifierBytes = await DefaultAssetBundle.of(context)
54- // .load('assets/bert_classifier.tflite');
53+ final ByteData classifierBytes = await DefaultAssetBundle .of (context)
54+ .load ('assets/bert_classifier.tflite' );
5555
56- final dir = io.Directory (path.current);
57- final modelPath = path.joinAll (
58- [dir.absolute.path, 'assets/bert_classifier.tflite' ],
59- );
60- _log.finest ('modelPath: $modelPath ' );
61- if (io.File (modelPath).existsSync ()) {
62- _log.fine ('Successfully found model.' );
63- } else {
64- _log.severe ('Invalid model path $modelPath . Model not found.' );
65- io.exit (1 );
66- }
56+ // final dir = io.Directory(path.current);
57+ // final modelPath = path.joinAll(
58+ // [dir.absolute.path, 'assets/bert_classifier.tflite'],
59+ // );
60+ // _log.finest('modelPath: $modelPath');
61+ // if (io.File(modelPath).existsSync()) {
62+ // _log.fine('Successfully found model.');
63+ // } else {
64+ // _log.severe('Invalid model path \n\t $modelPath.\n\nModel not found.');
65+ // io.exit(1);
66+ // }
6767
68- final sdkPath = path.joinAll (
69- [dir.absolute.path, 'assets/libtext_classifier.dylib' ],
70- );
71- _log.finest ('sdkPath: $sdkPath ' );
72- if (io.File (sdkPath).existsSync ()) {
73- _log.fine ('Successfully found SDK.' );
74- } else {
75- _log.severe ('Invalid SDK path $sdkPath . SDK not found.' );
76- io.exit (1 );
77- }
68+ // final sdkPath = path.joinAll(
69+ // [dir.absolute.path, 'assets/libtext_classifier.dylib'],
70+ // );
71+ // _log.finest('sdkPath: $sdkPath');
72+ // if (io.File(sdkPath).existsSync()) {
73+ // _log.fine('Successfully found SDK.');
74+ // } else {
75+ // _log.severe('Invalid SDK path $sdkPath. SDK not found.');
76+ // io.exit(1);
77+ // }
7878
7979 _classifier = TextClassifier (
80- options: TextClassifierOptions .fromAssetPath (modelPath),
81- // options: TextClassifierOptions.fromAssetBuffer(
82- // Uint8List.view(classifierBytes.buffer)),
80+ // options: TextClassifierOptions.fromAssetPath(modelPath),
81+ options: TextClassifierOptions .fromAssetBuffer (
82+ Uint8List .view (classifierBytes.buffer)),
8383 // sdkPath: sdkPath,
8484 );
8585 }
0 commit comments