浏览代码

Update BigDL detection

Lutz Roeder 5 年之前
父节点
当前提交
15cc08d7ef
共有 1 个文件被更改,包括 4 次插入7 次删除
  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) {