llm_logits / scripts /lfs_add.bash
3v324v23's picture
Nexusflow_Athene-V2-Chat_493f1bbd561a5a7e3d27c4081d4ee47508bf6831.logits-and-weights
413c34f
raw
history blame contribute delete
733 Bytes
# manually add a passed list of files to the local LFS store in a parallel manner bypassing filter-process
# original final revision of this script was lost. huggingface-cli also has functionality for bypassing git-lfs.
export GIT_DIR=$(git rev-parse --git-dir)
[ -d "$GIT_DIR" ] || exit -1
parallel -i bash -vx -c '\
sha=$(pv -c "{}" 2>/dev/tty | sha256sum | cut -d \ -f 1);\
size=$(($(stat -c %s "{}")));\
if (( size > 1024 )); then\
dir="$GIT_DIR"/lfs/objects/${sha:0:2}/${sha:2:2}/;\
mkdir -p "$dir";\
mv "{}" "$dir"/${sha} && {\
echo version https://git-lfs.github.com/spec/v1;\
echo oid sha256:"$sha";\
echo size "$size";\
} > "{}" &&\
git add "{}" || { mv "$dir"/${sha} "{}"; false; };\
fi'\
-- "$@"