Fix definition of tflite_smartreply
authorJustine Tunney <jart@google.com>
Mon, 11 Dec 2017 22:41:46 +0000 (14:41 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Mon, 11 Dec 2017 22:49:52 +0000 (14:49 -0800)
PiperOrigin-RevId: 178675580

tensorflow/workspace.bzl
third_party/repo.bzl

index 20e1aaaf6eced782c23bab87ca8e61e41e5815ba..b71f5dc4e57857fd57a14b36a30b44bee7433df8 100644 (file)
@@ -651,7 +651,6 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
       build_file = str(Label("//third_party/flatbuffers:flatbuffers.BUILD")),
   )
 
-
   tf_http_archive(
       name = "tflite_mobilenet",
       sha256 = "23f814d1c076bdf03715dfb6cab3713aa4fbdf040fd5448c43196bd2e97a4c1b",
@@ -662,6 +661,16 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
       build_file = str(Label("//third_party:tflite_mobilenet.BUILD")),
   )
 
+  tf_http_archive(
+      name = "tflite_smartreply",
+      sha256 = "8980151b85a87a9c1a3bb1ed4748119e4a85abd3cb5744d83da4d4bd0fbeef7c",
+      urls = [
+          "https://mirror.bazel.build/storage.googleapis.com/download.tensorflow.org/models/tflite/smartreply_1.0_2017_11_01.zip",
+          "https://storage.googleapis.com/download.tensorflow.org/models/tflite/smartreply_1.0_2017_11_01.zip"
+      ],
+      build_file = str(Label("//third_party:tflite_smartreply.BUILD")),
+  )
+
   ##############################################################################
   # BIND DEFINITIONS
   #
@@ -737,12 +746,3 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
       name = "zlib",
       actual = "@zlib_archive//:zlib",
   )
-
-  native.new_http_archive(
-      name = "tflite_smartreply",
-      build_file = str(Label("//third_party:tflite_smartreply.BUILD")),
-      sha256 = "8980151b85a87a9c1a3bb1ed4748119e4a85abd3cb5744d83da4d4bd0fbeef7c",
-      urls = [
-          "https://storage.googleapis.com/download.tensorflow.org/models/tflite/smartreply_1.0_2017_11_01.zip"
-      ],
-  )
index d6e5dfced0f2665d417dfd2b97f3623969b6e8aa..c29fef9629570955b4c4f192c03627bc65b2d49d 100644 (file)
@@ -67,8 +67,11 @@ def _tf_http_archive(ctx):
   if ("mirror.bazel.build" not in ctx.attr.urls[0] or
       (len(ctx.attr.urls) < 2 and
        ctx.attr.name not in _SINGLE_URL_WHITELIST)):
-    fail("tf_http_archive(urls) must have redundant URLs. The Bazel Mirror " +
-         "URL must come first. Please note mirroring happens after merge")
+    fail("tf_http_archive(urls) must have redundant URLs. The " +
+         "mirror.bazel.build URL must be present and it must come first. " +
+         "Even if you don't have permission to mirror the file, please " +
+         "put the correctly formatted mirror URL there anyway, because " +
+         "someone will come along shortly thereafter and mirror the file.")
   ctx.download_and_extract(
       ctx.attr.urls,
       "",