Merge pull request #191 from staticfloat/sf/cachedmodels

Use `cache.julialang.org` to store CMU phones
This commit is contained in:
Mike J Innes 2018-03-06 16:47:19 +00:00 committed by GitHub
commit 1a0ddbe4f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 6 deletions

View File

@ -5,13 +5,18 @@ export cmudict
using ..Data: deps
const version = "0.7b"
const cache_prefix = "https://cache.julialang.org"
function load()
isdir(deps("cmudict")) && return
suffixes = ["", ".phones", ".symbols"]
if isdir(deps("cmudict"))
if all(isfile.(["cmudict$x" for x in suffixes]))
return
end
end
mkpath(deps("cmudict"))
for x in ["", ".phones", ".symbols"]
download("http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-$version$x",
deps("cmudict", "cmudict$x"))
for x in suffixes
download("$cache_prefix/http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-$version$x", deps("cmudict", "cmudict$x"))
end
end

View File

@ -14,7 +14,7 @@ function load()
"t10k-images-idx3-ubyte",
"t10k-labels-idx1-ubyte"]
isfile(file) && continue
download("http://yann.lecun.com/exdb/mnist/$file.gz", "$file.gz")
download("https://cache.julialang.org/http://yann.lecun.com/exdb/mnist/$file.gz", "$file.gz")
open(file, "w") do io
write(io, GZip.open(read, "$file.gz"))
end

View File

@ -5,7 +5,7 @@ using ..Data: deps
function load()
isfile(deps("sentiment.zip")) ||
download("https://nlp.stanford.edu/sentiment/trainDevTestTrees_PTB.zip",
download("https://cache.julialang.org/https://nlp.stanford.edu/sentiment/trainDevTestTrees_PTB.zip",
deps("sentiment.zip"))
return
end