Merge pull request #191 from staticfloat/sf/cachedmodels
Use `cache.julialang.org` to store CMU phones
This commit is contained in:
commit
1a0ddbe4f1
@ -5,13 +5,18 @@ export cmudict
|
|||||||
using ..Data: deps
|
using ..Data: deps
|
||||||
|
|
||||||
const version = "0.7b"
|
const version = "0.7b"
|
||||||
|
const cache_prefix = "https://cache.julialang.org"
|
||||||
|
|
||||||
function load()
|
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"))
|
mkpath(deps("cmudict"))
|
||||||
for x in ["", ".phones", ".symbols"]
|
for x in suffixes
|
||||||
download("http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-$version$x",
|
download("$cache_prefix/http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-$version$x", deps("cmudict", "cmudict$x"))
|
||||||
deps("cmudict", "cmudict$x"))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ function load()
|
|||||||
"t10k-images-idx3-ubyte",
|
"t10k-images-idx3-ubyte",
|
||||||
"t10k-labels-idx1-ubyte"]
|
"t10k-labels-idx1-ubyte"]
|
||||||
isfile(file) && continue
|
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
|
open(file, "w") do io
|
||||||
write(io, GZip.open(read, "$file.gz"))
|
write(io, GZip.open(read, "$file.gz"))
|
||||||
end
|
end
|
||||||
|
@ -5,7 +5,7 @@ using ..Data: deps
|
|||||||
|
|
||||||
function load()
|
function load()
|
||||||
isfile(deps("sentiment.zip")) ||
|
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"))
|
deps("sentiment.zip"))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user