From fdb1acd2ffa961a0e8e83ae5de30d19213419a6c Mon Sep 17 00:00:00 2001 From: laurent Date: Mon, 3 Jul 2023 11:30:58 +0100 Subject: [PATCH 1/3] Move llama in a cargo-examples directory. --- Cargo.toml | 1 + candle-core/Cargo.toml | 5 ----- candle-examples/Cargo.toml | 22 +++++++++++++++++++ .../examples/llama/convert_checkpoint.py | 0 .../examples/llama/main.rs | 0 .../examples/llama/var_store.rs | 0 .../examples/llama/weights.rs | 0 candle-examples/src/lib.rs | 0 8 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 candle-examples/Cargo.toml rename {candle-core => candle-examples}/examples/llama/convert_checkpoint.py (100%) rename {candle-core => candle-examples}/examples/llama/main.rs (100%) rename {candle-core => candle-examples}/examples/llama/var_store.rs (100%) rename {candle-core => candle-examples}/examples/llama/weights.rs (100%) create mode 100644 candle-examples/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 7ecf17bb..e8d637a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] members = [ "candle-core", + "candle-examples", "candle-kernels", "candle-hub", "candle-pyo3", diff --git a/candle-core/Cargo.toml b/candle-core/Cargo.toml index ca3e75f1..85f77af5 100644 --- a/candle-core/Cargo.toml +++ b/candle-core/Cargo.toml @@ -27,11 +27,6 @@ zip = { version = "0.6.6", default-features=false } [dev-dependencies] anyhow = { version = "1", features = ["backtrace"] } -candle-hub = { path = "../candle-hub" } -clap = { version = "4.2.4", features = ["derive"] } -rand = "0.8.5" -tokenizers = { version = "0.13.3", default-features=false, features=["onig"] } -tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread"] } [features] default = ["cuda"] diff --git a/candle-examples/Cargo.toml b/candle-examples/Cargo.toml new file mode 100644 index 00000000..3cd2980e --- /dev/null +++ b/candle-examples/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "candle-examples" +version = "0.1.0" +edition = "2021" + +description = "Examples for the candle ML framework." +repository = "https://github.com/LaurentMazare/candle" +keywords = ["blas", "tensor", "machine-learning"] +categories = ["science"] +license = "MIT/Apache-2.0" +readme = "README.md" + +[dependencies] +candle = { path = "../candle-core" } + +[dev-dependencies] +anyhow = { version = "1", features = ["backtrace"] } +candle-hub = { path = "../candle-hub" } +clap = { version = "4.2.4", features = ["derive"] } +rand = "0.8.5" +tokenizers = { version = "0.13.3", default-features=false, features=["onig"] } +tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread"] } diff --git a/candle-core/examples/llama/convert_checkpoint.py b/candle-examples/examples/llama/convert_checkpoint.py similarity index 100% rename from candle-core/examples/llama/convert_checkpoint.py rename to candle-examples/examples/llama/convert_checkpoint.py diff --git a/candle-core/examples/llama/main.rs b/candle-examples/examples/llama/main.rs similarity index 100% rename from candle-core/examples/llama/main.rs rename to candle-examples/examples/llama/main.rs diff --git a/candle-core/examples/llama/var_store.rs b/candle-examples/examples/llama/var_store.rs similarity index 100% rename from candle-core/examples/llama/var_store.rs rename to candle-examples/examples/llama/var_store.rs diff --git a/candle-core/examples/llama/weights.rs b/candle-examples/examples/llama/weights.rs similarity index 100% rename from candle-core/examples/llama/weights.rs rename to candle-examples/examples/llama/weights.rs diff --git a/candle-examples/src/lib.rs b/candle-examples/src/lib.rs new file mode 100644 index 00000000..e69de29b From 8215eacceb9e153b6cdfbd8bb9e103b74e85c5d1 Mon Sep 17 00:00:00 2001 From: laurent Date: Mon, 3 Jul 2023 11:32:50 +0100 Subject: [PATCH 2/3] Formatting. --- candle-examples/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/candle-examples/src/lib.rs b/candle-examples/src/lib.rs index e69de29b..8b137891 100644 --- a/candle-examples/src/lib.rs +++ b/candle-examples/src/lib.rs @@ -0,0 +1 @@ + From cb03364718396494cecd40b935a002d72c863291 Mon Sep 17 00:00:00 2001 From: laurent Date: Mon, 3 Jul 2023 11:34:02 +0100 Subject: [PATCH 3/3] Fix the CI. --- candle-examples/Cargo.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/candle-examples/Cargo.toml b/candle-examples/Cargo.toml index 3cd2980e..a71ca17b 100644 --- a/candle-examples/Cargo.toml +++ b/candle-examples/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT/Apache-2.0" readme = "README.md" [dependencies] -candle = { path = "../candle-core" } +candle = { path = "../candle-core", default-features=false } [dev-dependencies] anyhow = { version = "1", features = ["backtrace"] } @@ -20,3 +20,7 @@ clap = { version = "4.2.4", features = ["derive"] } rand = "0.8.5" tokenizers = { version = "0.13.3", default-features=false, features=["onig"] } tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread"] } + +[features] +default = ["cuda"] +cuda = ["candle/cuda"]