Runs
This commit is contained in:
0
.local/share/pytorch_pod/python-apps/embed-multimodal-7b.py
Normal file → Executable file
0
.local/share/pytorch_pod/python-apps/embed-multimodal-7b.py
Normal file → Executable file
@@ -22,7 +22,9 @@ AI_MODELS_DIR="$BIND_DIR/ai-models"
|
|||||||
PYTHON_APPS_DIR="$BIND_DIR/python-apps"
|
PYTHON_APPS_DIR="$BIND_DIR/python-apps"
|
||||||
USER_SYSTEMD_DIR="$HOME/.config/systemd/user"
|
USER_SYSTEMD_DIR="$HOME/.config/systemd/user"
|
||||||
CONTAINERFILE="$BIND_DIR/containerfile"
|
CONTAINERFILE="$BIND_DIR/containerfile"
|
||||||
PY_APP="$PYTHON_APPS_DIR/colnomic-embed-multimodal-7b.py"
|
PY_APP="$PYTHON_APPS_DIR/embed-multimodal-7b.py"
|
||||||
|
|
||||||
|
echo "$PY_APP"
|
||||||
|
|
||||||
# Prepare directories
|
# Prepare directories
|
||||||
mkdir -p "$AI_MODELS_DIR" "$PYTHON_APPS_DIR" "$USER_SYSTEMD_DIR"
|
mkdir -p "$AI_MODELS_DIR" "$PYTHON_APPS_DIR" "$USER_SYSTEMD_DIR"
|
||||||
@@ -102,7 +104,7 @@ podman run -d --name "$CTR_NAME" --pod "$POD_NAME" \
|
|||||||
-v "$AI_MODELS_DIR":/models \
|
-v "$AI_MODELS_DIR":/models \
|
||||||
-v "$PYTHON_APPS_DIR":/python-apps \
|
-v "$PYTHON_APPS_DIR":/python-apps \
|
||||||
"$CUSTOM_IMAGE" \
|
"$CUSTOM_IMAGE" \
|
||||||
python "$PY_APP"
|
python /python-apps/embed-multimodal-7b.py
|
||||||
|
|
||||||
# Wait for API readiness (/health)
|
# Wait for API readiness (/health)
|
||||||
HEALTH_URL="http://$HOST_LOCAL_IP:$PYTORCH_HOST_PORT/health"
|
HEALTH_URL="http://$HOST_LOCAL_IP:$PYTORCH_HOST_PORT/health"
|
||||||
@@ -171,7 +173,7 @@ if ! printf '%s' "$HEALTH_JSON" | grep -q '"status":"ok"'; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Python API /embed
|
# Python API /embed
|
||||||
EMBED_URL="http://$HOST_LOCAL_IP:$PYTORCH_HOST_PORT/embed"
|
EMBED_URL="http://$HOST_LOCAL_IP:$PYTORCH_HOST_PORT/embed-texts"
|
||||||
EMBED_JSON="$(curl -fsS -X POST "$EMBED_URL" \
|
EMBED_JSON="$(curl -fsS -X POST "$EMBED_URL" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"texts":["hello world from colnomic"]}')"
|
-d '{"texts":["hello world from colnomic"]}')"
|
||||||
|
|||||||
Reference in New Issue
Block a user