Implement Nodes to compute text embeddings
This commit is contained in:
parent
72765532d3
commit
49239e7e25
9 changed files with 505 additions and 25 deletions
16
transform/ensure_minilm_model.sh
Normal file
16
transform/ensure_minilm_model.sh
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if [ -d "$MINILM_MODEL_PATH" ] && find "$MINILM_MODEL_PATH" -type f | grep -q .; then
|
||||
echo "MiniLM model already present at $MINILM_MODEL_PATH"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Downloading MiniLM model to $MINILM_MODEL_PATH"
|
||||
mkdir -p "$MINILM_MODEL_PATH"
|
||||
curl -sL "https://huggingface.co/api/models/${MINILM_MODEL_ID}" | jq -r '.siblings[].rfilename' | while read -r file; do
|
||||
target="${MINILM_MODEL_PATH}/${file}"
|
||||
mkdir -p "$(dirname "$target")"
|
||||
echo "Downloading ${file}"
|
||||
curl -sL "https://huggingface.co/${MINILM_MODEL_ID}/resolve/main/${file}" -o "$target"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue