Набор всяких штук для деплоя.
Предполагается что ROCM стоит на хосте!
This commit is contained in:
19
.env.example
19
.env.example
@@ -1,13 +1,22 @@
|
||||
|
||||
# Server configuration
|
||||
HOST=0.0.0.0
|
||||
PORT=9854
|
||||
|
||||
# Model configuration
|
||||
DEFAULT_MODEL=turbo
|
||||
MODEL_DOWNLOAD_ROOT=/app/models
|
||||
DEFAULT_MODEL=tiny
|
||||
MODEL_DOWNLOAD_ROOT=./models
|
||||
|
||||
# API Keys
|
||||
KEYS_FILE=/app/keys.txt
|
||||
# Security configuration
|
||||
KEYS_FILE=keys.txt
|
||||
|
||||
# Logging
|
||||
# Logging configuration (optional)
|
||||
LOG_LEVEL=INFO
|
||||
|
||||
# ROCm GPU configuration
|
||||
HSA_OVERRIDE_GFX_VERSION=10.3.0
|
||||
ROCM_PATH=/opt/rocm
|
||||
|
||||
# Example of available Whisper models:
|
||||
# tiny, base, small, medium, large, turbo
|
||||
# turbo is recommended for best speed/quality balance
|
||||
|
||||
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
12
.idea/material_theme_project_new.xml
generated
Normal file
12
.idea/material_theme_project_new.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MaterialThemeProjectNewConfig">
|
||||
<option name="metadata">
|
||||
<MTProjectMetadataState>
|
||||
<option name="migrated" value="true" />
|
||||
<option name="pristineConfig" value="false" />
|
||||
<option name="userId" value="-6077f146:198b84bb7ea:-7ffe" />
|
||||
</MTProjectMetadataState>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
7
.idea/misc.xml
generated
Normal file
7
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.13 (simple-asr-server)" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 (simple-asr-server)" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,5 +1,5 @@
|
||||
# Use ROCm compatible Python image as base
|
||||
FROM rocm/pytorch:rocm6.1_ubuntu22.04_py3.10_pytorch_2.1.2
|
||||
# Use official Python image as base
|
||||
FROM python:3.10-slim
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
@@ -31,8 +31,6 @@ RUN mkdir -p /app/models /app/data
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV MODEL_DOWNLOAD_ROOT=/app/models
|
||||
ENV KEYS_FILE=/app/data/keys.txt
|
||||
ENV HSA_OVERRIDE_GFX_VERSION=10.3.0
|
||||
ENV ROCM_PATH=/opt/rocm
|
||||
|
||||
# Expose port
|
||||
EXPOSE 9854
|
||||
@@ -43,4 +41,3 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
||||
|
||||
# Run the application
|
||||
CMD ["python", "app.py"]
|
||||
|
||||
|
||||
@@ -3,3 +3,5 @@ uvicorn[standard]
|
||||
python-multipart
|
||||
openai-whisper
|
||||
python-dotenv
|
||||
|
||||
|
||||
|
||||
17
start_server.sh
Normal file → Executable file
17
start_server.sh
Normal file → Executable file
@@ -32,6 +32,22 @@ export LOG_LEVEL=${LOG_LEVEL:-"INFO"}
|
||||
mkdir -p "${MODEL_DOWNLOAD_ROOT}"
|
||||
mkdir -p "$(dirname "${KEYS_FILE}")"
|
||||
|
||||
# Check if virtual environment exists, create if not
|
||||
VENV_DIR="${APP_DIR}/venv"
|
||||
if [ ! -d "${VENV_DIR}" ]; then
|
||||
echo "Creating virtual environment..."
|
||||
python3 -m venv "${VENV_DIR}"
|
||||
fi
|
||||
|
||||
# Activate virtual environment
|
||||
echo "Activating virtual environment..."
|
||||
source "${VENV_DIR}/bin/activate"
|
||||
|
||||
# Install/upgrade dependencies
|
||||
echo "Installing/upgrading dependencies..."
|
||||
pip install --upgrade pip
|
||||
pip install -r "${APP_DIR}/requirements.txt"
|
||||
|
||||
# Change to app directory
|
||||
cd "${APP_DIR}"
|
||||
|
||||
@@ -45,3 +61,4 @@ echo "Log Level: ${LOG_LEVEL}"
|
||||
|
||||
# Start the application
|
||||
exec python3 app.py
|
||||
|
||||
|
||||
Reference in New Issue
Block a user