Browse Source

Update BigDL detection

Lutz Roeder 5 years ago
parent
commit
15cc08d7ef
1 changed files with 4 additions and 7 deletions
  1. 4 7
      source/bigdl.js

+ 4 - 7
source/bigdl.js

@@ -8,14 +8,11 @@ var protobuf = protobuf || require('./protobuf');
 bigdl.ModelFactory = class {
 
     match(context) {
-        const identifier = context.identifier;
-        const extension = identifier.split('.').pop().toLowerCase();
-        if (extension == 'model' || extension == 'bigdl') {
-            const tags = context.tags('pb');
-            if (tags.has(2) && tags.has(7) && tags.has(8) && tags.has(9) && tags.has(10) && tags.has(11) && tags.has(12)) {
-                return true;
-            }
+        const tags = context.tags('pb');
+        if (tags.has(2) && tags.has(7) && tags.has(8) && tags.has(9) && tags.has(10) && tags.has(11) && tags.has(12)) {
+            return true;
         }
+        return false;
     }
 
     open(context, host) {