2024-10-01 16:02:06 +00:00
|
|
|
{
|
2025-03-13 09:45:47 +00:00
|
|
|
stdenv,
|
2024-10-01 16:02:06 +00:00
|
|
|
dockerTools,
|
|
|
|
cacert,
|
|
|
|
text-generation-inference,
|
|
|
|
stream ? false,
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
build = if stream then dockerTools.streamLayeredImage else dockerTools.buildLayeredImage;
|
|
|
|
in
|
|
|
|
build {
|
|
|
|
name = "tgi-docker";
|
|
|
|
tag = "latest";
|
2025-03-18 11:58:21 +00:00
|
|
|
compressor = "zstd";
|
2024-10-01 16:02:06 +00:00
|
|
|
config = {
|
|
|
|
EntryPoint = [ "${text-generation-inference}/bin/text-generation-inference" ];
|
|
|
|
Env = [
|
|
|
|
"HF_HOME=/data"
|
|
|
|
"PORT=80"
|
2025-03-13 13:02:45 +00:00
|
|
|
# The CUDA container toolkit will mount the driver shim into the
|
|
|
|
# container. We just have to ensure that the dynamic loader finds
|
|
|
|
# the libraries.
|
|
|
|
"LD_LIBRARY_PATH=/usr/lib64"
|
2024-10-01 16:02:06 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
};
|
2025-03-13 10:26:44 +00:00
|
|
|
extraCommands = ''
|
|
|
|
mkdir -p tmp
|
|
|
|
chmod -R 1777 tmp
|
|
|
|
'';
|
2025-03-13 09:45:47 +00:00
|
|
|
contents = [
|
|
|
|
cacert
|
|
|
|
stdenv.cc
|
|
|
|
];
|
2024-10-01 16:02:06 +00:00
|
|
|
}
|