From b212d8316153ebe282cbe1e4c65f96bc42dbb15e Mon Sep 17 00:00:00 2001 From: vladislav Date: Sun, 7 Sep 2025 16:58:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=B7=D0=B0=D0=BF=D1=83?= =?UTF-8?q?=D1=81=D0=BA=D0=B0=20=D1=81=D0=BE=20=D1=81=D0=BA=D1=80=D0=B8?= =?UTF-8?q?=D0=BF=D1=82=D0=B0=20=D0=BD=D0=B0=20=D1=85=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B5=20=D0=BD=D0=B0=20ROCm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 6 ++++++ start_server.sh | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/requirements.txt b/requirements.txt index 9bc17d4..84acfc5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,9 @@ +# PyTorch с поддержкой ROCm +--index-url https://download.pytorch.org/whl/rocm6.0 +torch +torchaudio + +# Остальные зависимости fastapi uvicorn[standard] python-multipart diff --git a/start_server.sh b/start_server.sh index 1bcfa99..d22a81f 100755 --- a/start_server.sh +++ b/start_server.sh @@ -9,6 +9,16 @@ set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" APP_DIR="${SCRIPT_DIR}" +# Set ROCm environment variables if ROCm is available +if [ -d "/opt/rocm" ]; then + export ROCM_PATH=${ROCM_PATH:-"/opt/rocm"} + export PATH="${ROCM_PATH}/bin:${PATH}" + export LD_LIBRARY_PATH="${ROCM_PATH}/lib:${LD_LIBRARY_PATH:-}" + # Set HIP_VISIBLE_DEVICES to use all available GPUs + export HIP_VISIBLE_DEVICES=${HIP_VISIBLE_DEVICES:-"0"} + echo "ROCm detected, configured environment variables" +fi + # Function to generate a secure API key generate_api_key() { if command -v openssl >/dev/null 2>&1; then