Skip to content
This repository has been archived by the owner on Dec 18, 2020. It is now read-only.

Commit

Permalink
Update to sentencepiece 0.3
Browse files Browse the repository at this point in the history
This also requires us to update to nixpkgs-unstable, since the
sentencepiece crate now requires sentencepiece 0.1.90.
  • Loading branch information
danieldk committed Jul 7, 2020
1 parent 5d883a7 commit 0f6837a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 29 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "nixos-20.03",
"branch": "nixos-unstable",
"description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
"homepage": "https://github.com/NixOS/nixpkgs",
"owner": "nixos",
"repo": "nixpkgs-channels",
"rev": "025deb80b2412e5b7e88ea1de631d1bd65af1840",
"sha256": "09mp6vqs0h71g27w004yrz1jxla31ihf18phw69wj61ix74ac4m0",
"rev": "dc80d7bc4a244120b3d766746c41c0d9c5f81dfa",
"sha256": "0dy0mp7alc7m34zxall14x42qx9yjm7b0m6psgmw0lb6j1iy1pla",
"type": "tarball",
"url": "https://github.com/nixos/nixpkgs-channels/archive/025deb80b2412e5b7e88ea1de631d1bd65af1840.tar.gz",
"url": "https://github.com/nixos/nixpkgs-channels/archive/dc80d7bc4a244120b3d766746c41c0d9c5f81dfa.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"xlm-roberta-base-sentencepiece": {
Expand Down
36 changes: 16 additions & 20 deletions nix/sources.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,22 @@ let

# The set of packages used when specs are fetched using non-builtins.
mkPkgs = sources:
if hasNixpkgsPath
then
if hasThisAsNixpkgsPath
then import (builtins_fetchTarball { inherit (mkNixpkgs sources) url sha256; }) {}
else import <nixpkgs> {}
else
import (builtins_fetchTarball { inherit (mkNixpkgs sources) url sha256; }) {};

mkNixpkgs = sources:
if builtins.hasAttr "nixpkgs" sources
then sources.nixpkgs
else abort
''
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
add a package called "nixpkgs" to your sources.json.
'';

hasNixpkgsPath = (builtins.tryEval <nixpkgs>).success;
hasThisAsNixpkgsPath =
(builtins.tryEval <nixpkgs>).success && <nixpkgs> == ./.;
let
sourcesNixpkgs =
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {};
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
in
if builtins.hasAttr "nixpkgs" sources
then sourcesNixpkgs
else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
import <nixpkgs> {}
else
abort
''
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
add a package called "nixpkgs" to your sources.json.
'';

# The actual fetching function.
fetch = pkgs: name: spec:
Expand Down
2 changes: 1 addition & 1 deletion sticker2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ numberer = "0.2"
ordered-float = "1"
rand = "0.7"
rand_xorshift = "0.2"
sentencepiece = "0.2"
sentencepiece = "0.3"
serde = { version = "1", features = [ "derive" ] }
serde_json = "1"
sticker-encoders = "0.5.1"
Expand Down

0 comments on commit 0f6837a

Please sign in to comment.