This commit is contained in:
unknown
2025-12-12 17:10:37 -08:00
parent e7e72f6350
commit 07ea65028f
3 changed files with 7 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ LABEL org.opencontainers.image.title="ebook2audiobook" \
org.opencontainers.image.source="https://github.com/DrewThomasson/ebook2audiobook"
ARG DEVICE_TAG=cpu
ARG DOCKER_DEVICE_STR='{"name": "${DEVICE_TAG}", "os": "linux", "arch": "x86_64", "pyvenv": [3, 12], "tag": "${DEVICE_TAG}", "note": ""}'
ARG DOCKER_DEVICE_STR='{"name": "cpu", "os": "linux", "arch": "x86_64", "pyvenv": [3, 12], "tag": "cpu", "note": ""}'
ARG DOCKER_PROGRAMS_STR=curl ffmpeg nodejs espeak-ng sox tesseract-ocr
ARG CALIBRE_INSTALLER_URL="https://download.calibre-ebook.com/linux-installer.sh"
ARG ISO3_LANG=eng

View File

@@ -730,6 +730,11 @@ YOU CAN IMPROVE IT OR ASK TO A TRAINING MODEL EXPERT.
print(msg)
else:
use_gpu = True if (session['device'] == devices['CUDA']['proc'] and devices['CUDA']['found']) or (session['device'] == devices['JETSON']['proc'] and devices['JETSON']['found']) or (session['device'] == devices['ROCM']['proc'] and devices['ROCM']['found']) or (session['device'] == devices['XPU']['proc'] and devices['XPU']['found'])else False
use_gpu = True if (
(session['device'] == devices['CUDA']['proc'] and not devices['JETSON']['found'] and devices['CUDA']['found']) or
(session['device'] == devices['ROCM']['proc'] and devices['ROCM']['found']) or
(session['device'] == devices['XPU']['proc'] and devices['XPU']['found'])
) else False
stanza_nlp = stanza.Pipeline(session['language_iso1'], processors='tokenize,ner,mwt', use_gpu=use_gpu, download_method=DownloadMethod.REUSE_RESOURCES, dir=os.getenv('STANZA_RESOURCES_DIR'))
if stanza_nlp:
session['stanza_cache'] = stanza_model

View File

@@ -25,12 +25,11 @@ services:
# NVIDIA CUDA requires NVIDIA Container Toolkit + CDI generated on host
- nvidia.com/gpu=all
# Intel XPU / oneAPI / Arc iGPU
# Intel XPU / oneAPI / Arc iGPU / ROCm
- /dev/dri:/dev/dri
# AMD ROCm
- /dev/kfd:/dev/kfd
- /dev/dri:/dev/dri
group_add:
- video