-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMODULE.bazel
201 lines (181 loc) · 5.85 KB
/
MODULE.bazel
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
module(name = "examples")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_zig", version = "20240913.0-1957d05")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "zml", version = "0.1.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.11.0")
bazel_dep(name = "rules_oci", version = "2.0.0")
non_module_deps = use_extension("//:third_party/non_module_deps.bzl", "non_module_deps")
use_repo(non_module_deps, "com_github_hejsil_clap")
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "distroless_cc_debian12",
digest = "sha256:1850aee2ff72864350058d83d681c757d45c885986d15fcca7309b9e5c69f39a",
image = "gcr.io/distroless/cc-debian12",
platforms = [
"linux/amd64",
],
)
use_repo(oci, "distroless_cc_debian12", "distroless_cc_debian12_linux_amd64")
oci.pull(
name = "distroless_cc_debian12_debug",
digest = "sha256:ae6f470336acbf2aeffea3db70ec0e74d69bee7270cdb5fa2f28fe840fad57fe",
image = "gcr.io/distroless/cc-debian12",
platforms = [
"linux/amd64",
],
)
use_repo(oci, "distroless_cc_debian12_debug", "distroless_cc_debian12_debug_linux_amd64")
# Mnist weights
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
http_file(
name = "com_github_ggerganov_ggml_mnist",
downloaded_file_path = "mnist.pt",
sha256 = "d8a25252e28915e147720c19223721f0f53e3317493727ca754a2dd672450ba9",
url = "https://github.com/ggerganov/ggml/raw/18703ad600cc68dbdb04d57434c876989a841d12/examples/mnist/models/mnist/mnist_model.state_dict",
)
http_file(
name = "com_github_ggerganov_ggml_mnist_data",
downloaded_file_path = "mnist.ylc",
sha256 = "0fa7898d509279e482958e8ce81c8e77db3f2f8254e26661ceb7762c4d494ce7",
url = "https://github.com/ggerganov/ggml/raw/18703ad600cc68dbdb04d57434c876989a841d12/examples/mnist/models/mnist/t10k-images.idx3-ubyte",
)
# Llama 3.2
huggingface = use_extension("@zml//bazel:huggingface.bzl", "huggingface")
huggingface.model(
name = "Meta-Llama-3.2-1B-Instruct",
build_file_content = """\
package(default_visibility = ["//visibility:public"])
filegroup(
name = "Meta-Llama-3.2-1B-Instruct",
srcs = glob(["*.json", "*.safetensors"]),
)
""",
commit = "9213176726f574b556790deb65791e0c5aa438b6",
includes = [
"*.safetensors",
"*.json",
],
model = "meta-llama/Llama-3.2-1B-Instruct",
)
use_repo(huggingface, "Meta-Llama-3.2-1B-Instruct")
huggingface.model(
name = "Meta-Llama-3.2-3B-Instruct",
build_file_content = """\
package(default_visibility = ["//visibility:public"])
filegroup(
name = "Meta-Llama-3.2-3B-Instruct",
srcs = glob(["*.json", "*.safetensors"]),
)
""",
commit = "0cb88a4f764b7a12671c53f0838cd831a0843b95",
includes = [
"*.safetensors",
"*.json",
],
model = "meta-llama/Llama-3.2-3B-Instruct",
)
use_repo(huggingface, "Meta-Llama-3.2-3B-Instruct")
# Llama 3.1
huggingface.model(
name = "Meta-Llama-3.1-8B-Instruct",
build_file_content = """\
package(default_visibility = ["//visibility:public"])
filegroup(
name = "Meta-Llama-3.1-8B-Instruct",
srcs = glob(["*.json", "*.safetensors"]),
)
""",
commit = "5206a32e0bd3067aef1ce90f5528ade7d866253f",
includes = [
"*.safetensors",
"*.json",
],
model = "meta-llama/Meta-Llama-3.1-8B-Instruct",
)
use_repo(huggingface, "Meta-Llama-3.1-8B-Instruct")
huggingface.model(
name = "Meta-Llama-3.1-70B-Instruct",
build_file_content = """\
package(default_visibility = ["//visibility:public"])
filegroup(
name = "Meta-Llama-3.1-70B-Instruct",
srcs = glob(["*.json", "*.safetensors"]),
)
""",
commit = "945c8663693130f8be2ee66210e062158b2a9693",
includes = [
"*.safetensors",
"*.json",
],
model = "meta-llama/Meta-Llama-3.1-70B-Instruct",
)
use_repo(huggingface, "Meta-Llama-3.1-70B-Instruct")
http_file(
name = "Karpathy-TinyLlama-Stories15M",
downloaded_file_path = "stories15M.tinyllama",
sha256 = "cd590644d963867a2b6e5a1107f51fad663c41d79c149fbecbbb1f95fa81f49a",
url = "https://huggingface.co/karpathy/tinyllamas/resolve/0bd21da7698eaf29a0d7de3992de8a46ef624add/stories15M.bin?download=true",
)
http_file(
name = "Karpathy-TinyLlama-Tokenizer",
downloaded_file_path = "stories260K.tinyllama",
sha256 = "50a52ef822ee9e83de5ce9d0be0a025a773d019437f58b5ff9dcafb063ece361",
url = "https://github.com/karpathy/llama2.c/raw/c02865df300f3bd9e567ce061000dc23bf785a17/tokenizer.bin",
)
# ModernBERT
huggingface.model(
name = "ModernBERT-base",
build_file_content = """\
package(default_visibility = ["//visibility:public"])
filegroup(
name = "model",
srcs = ["model.safetensors"],
)
filegroup(
name = "tokenizer",
srcs = ["tokenizer.json"],
)
""",
commit = "94032bb66234a691cf6248265170006a7ced4970",
includes = [
"model.safetensors",
"tokenizer.json",
],
model = "answerdotai/ModernBERT-base",
)
use_repo(huggingface, "ModernBERT-base")
huggingface.model(
name = "ModernBERT-large",
build_file_content = """\
package(default_visibility = ["//visibility:public"])
filegroup(
name = "model",
srcs = ["model.safetensors"],
)
filegroup(
name = "tokenizer",
srcs = ["tokenizer.json"],
)
""",
commit = "4bbcbf40bed02ce487125bcb3c897ea9bdc88340",
includes = [
"model.safetensors",
"tokenizer.json",
],
model = "answerdotai/ModernBERT-large",
)
use_repo(huggingface, "ModernBERT-large")
bazel_dep(name = "rules_rust", version = "0.57.1")
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2021",
versions = ["1.84.0"],
extra_target_triples = [
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"x86_64-unknown-linux-gnu",
],
)
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")