File size: 736 Bytes
cb824d6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8d49354
cb824d6
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Tar, Inflate, SHA, TOML

artifacts = Dict()

folders = ["CrI3", "Si", "Si2"]

for folder in folders
  fullpath = joinpath("datasets", folder)
  isdir(fullpath) || continue
  outpath  = joinpath(pwd(),"artifacts","$folder.tar.gz")

  cd(fullpath) do
    run(`tar -cvzf $outpath $(readdir())`)
  end

  artifact_name = folder
  artifacts[folder] = Dict(
      "git-tree-sha1" => Tar.tree_hash(IOBuffer(inflate_gzip(outpath))),
      "lazy" => true,
      "download" => [Dict(
      "url" => "https://huggingface.co/datasets/atomology/QuantumEspressoDatasets/resolve/main/artifacts/$(folder).tar.gz",
      "sha256" => bytes2hex(open(sha256, outpath)))]
    )
end

open("Artifacts.toml", "w") do io
    TOML.print(io, artifacts)
end