File size: 545 Bytes
add24bd
 
 
 
4dfed21
75af375
4dfed21
 
75af375
add24bd
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash
# Hugging Face Spaces: install vendored custom Ultralytics before app starts.
set -euo pipefail
cd "$(dirname "$0")"
# HF base image may install huggingface_hub 1.x; Gradio 4.x needs <1.0 (HfFolder)
pip install -q "huggingface_hub>=0.23.0,<1.0"
export YOLO_CONFIG_DIR="${YOLO_CONFIG_DIR:-/tmp/Ultralytics}"
mkdir -p "${YOLO_CONFIG_DIR}"

if [[ -d vendor ]]; then
  pip install -q -e ./vendor
  echo "Installed custom ultralytics from ./vendor"
else
  echo "WARN: vendor/ missing — run prepare_space.sh before deploying"
fi