Skip to content

Commit d25e5d1

Browse files
committed
style: 简化 test-utils
Signed-off-by: YdrMaster <ydrml@hotmail.com>
1 parent d67f60f commit d25e5d1

File tree

20 files changed

+85
-74
lines changed

20 files changed

+85
-74
lines changed

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ members = [
2020
]
2121
resolver = "2"
2222

23+
[workspace.package]
24+
edition = "2021"
25+
2326
[workspace.dependencies]
2427
common.path = "common"
2528
gguf.path = "gguf"
2629
tensor.path = "tensor"
2730
causal-lm.path = "causal-lm"
28-
test-utils = { path = "test-utils", default-features = false }
31+
test-utils.path = "test-utils"
2932

3033
ggus = "0.4"
3134
ndarray-layout = "0.0"

common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "common"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition.workspace = true
55
authors = ["YdrMaster <ydrml@hotmail.com>"]
66

77
[dependencies]

gguf/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "gguf"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition.workspace = true
55
authors = ["YdrMaster <ydrml@hotmail.com>"]
66

77
[dependencies]

models/clip/common-cpu/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clip-cpu"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition.workspace = true
55
authors = ["YdrMaster <ydrml@hotmail.com>"]
66

77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

models/clip/common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clip"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition.workspace = true
55
authors = ["YdrMaster <ydrml@hotmail.com>"]
66

77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

models/gpt2/common-cpu/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "gpt2-cpu"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition.workspace = true
55
authors = ["onenewcode <lovestudy@qq.com>", "YdrMaster <ydrml@hotmail.com>"]
66

77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -12,6 +12,6 @@ common.workspace = true
1212
operators = { workspace = true, features = ["common-cpu"] }
1313

1414
[dev-dependencies]
15-
test-utils = { workspace = true, features = ["gpt2"] }
15+
test-utils.workspace = true
1616
gguf.workspace = true
1717
regex.workspace = true

models/gpt2/common-cpu/src/infer.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,17 @@ fn test_infer() {
138138

139139
let senders = senders.into_boxed_slice();
140140
barrier.wait();
141-
test_infer_paralle(&model, senders, eos, tokenizer, &prompt, max_steps)
141+
test_infer_paralle(
142+
senders,
143+
test_utils::AboutToken {
144+
tokenizer,
145+
token_embd: model.token_embd,
146+
nvoc: model.meta.nvoc,
147+
eos,
148+
},
149+
&prompt,
150+
max_steps,
151+
)
142152
})
143153
}
144154

models/gpt2/common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "gpt2"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition.workspace = true
55
authors = ["onenewcode <lovestudy@qq.com>", "YdrMaster <ydrml@hotmail.com>"]
66

77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

models/gpt2/cuda/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "gpt2-cuda"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition.workspace = true
55
authors = ["onenewcode <lovestudy@qq.com>", "YdrMaster <ydrml@hotmail.com>"]
66

77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -18,6 +18,6 @@ search-cuda-tools.workspace = true
1818
search-corex-tools.workspace = true
1919

2020
[dev-dependencies]
21-
test-utils = { workspace = true, features = ["gpt2"] }
21+
test-utils.workspace = true
2222
gguf.workspace = true
2323
regex.workspace = true

models/llama/common-cpu/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "llama-cpu"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition.workspace = true
55
authors = ["YdrMaster <ydrml@hotmail.com>"]
66

77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -12,6 +12,6 @@ common.workspace = true
1212
operators = { workspace = true, features = ["common-cpu"] }
1313

1414
[dev-dependencies]
15-
test-utils = { workspace = true, features = ["llama"] }
15+
test-utils.workspace = true
1616
gguf.workspace = true
1717
regex.workspace = true

0 commit comments

Comments
 (0)