-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmix.exs
More file actions
146 lines (126 loc) · 3.51 KB
/
mix.exs
File metadata and controls
146 lines (126 loc) · 3.51 KB
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
defmodule HfDatasetsEx.MixProject do
use Mix.Project
@version "0.1.2"
@source_url "https://github.com/North-Shore-AI/hf_datasets_ex"
def project do
[
app: :hf_datasets_ex,
version: @version,
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
deps: deps(),
docs: docs(),
dialyzer: [plt_add_apps: [:mix]],
description: description(),
package: package(),
name: "HfDatasetsEx",
source_url: @source_url,
homepage_url: @source_url
]
end
def cli do
[preferred_envs: ["test.live": :test]]
end
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[
{:jason, "~> 1.4"},
{:telemetry, "~> 1.3"},
{:dialyxir, "~> 1.4", only: [:dev], runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
# HuggingFace Hub client (API, downloads, caching, auth)
{:hf_hub, "~> 0.1.1"},
# DataFrames + Parquet support
{:explorer, "~> 0.11.1"},
# Tensor library
{:nx, "~> 0.9"},
# Image decoding (libvips)
{:vix, "~> 0.35"},
# Documentation
{:ex_doc, "~> 0.38", only: :dev, runtime: false},
# Test utilities
{:bypass, "~> 2.1", only: :test}
]
end
defp description do
"""
HuggingFace Datasets for Elixir - Load, stream, and process ML datasets from the HuggingFace Hub with native BEAM/OTP integration.
"""
end
defp docs do
[
main: "readme",
name: "HfDatasetsEx",
source_ref: "v#{@version}",
source_url: @source_url,
homepage_url: @source_url,
logo: "assets/hf_datasets_ex.svg",
extras: extras(),
groups_for_extras: groups_for_extras(),
assets: %{"assets" => "assets"},
before_closing_head_tag: &mermaid_config/1
]
end
defp extras do
[
"README.md",
"CHANGELOG.md",
"LICENSE"
]
end
defp groups_for_extras do
[
Guides: ["README.md"],
"Release Notes": ["CHANGELOG.md"]
]
end
defp mermaid_config(:html) do
"""
<script defer src="https://cdn.jsdelivr.net/npm/mermaid@10.2.3/dist/mermaid.min.js"></script>
<script>
let initialized = false;
window.addEventListener("exdoc:loaded", () => {
if (!initialized) {
mermaid.initialize({
startOnLoad: false,
theme: document.body.className.includes("dark") ? "dark" : "default"
});
initialized = true;
}
let id = 0;
for (const codeEl of document.querySelectorAll("pre code.mermaid")) {
const preEl = codeEl.parentElement;
const graphDefinition = codeEl.textContent;
const graphEl = document.createElement("div");
const graphId = "mermaid-graph-" + id++;
mermaid.render(graphId, graphDefinition).then(({svg, bindFunctions}) => {
graphEl.innerHTML = svg;
bindFunctions?.(graphEl);
preEl.insertAdjacentElement("afterend", graphEl);
preEl.remove();
});
}
});
</script>
"""
end
defp mermaid_config(_), do: ""
defp package do
[
name: "hf_datasets_ex",
description: description(),
files: ~w(lib mix.exs README.md CHANGELOG.md LICENSE),
licenses: ["MIT"],
links: %{
"GitHub" => @source_url,
"Online documentation" => "https://hexdocs.pm/hf_datasets_ex",
"Changelog" => "#{@source_url}/blob/main/CHANGELOG.md"
},
maintainers: ["nshkrdotcom"]
]
end
end