From fefb34c2743d432902b2158a83eedb0055af659d Mon Sep 17 00:00:00 2001 From: jiltseb Date: Fri, 1 Nov 2024 12:33:13 +0000 Subject: [PATCH] workaround for cudnn ctranslate2 issue ftb --- aana/deployments/whisper_deployment.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/aana/deployments/whisper_deployment.py b/aana/deployments/whisper_deployment.py index 6bd31a76..162d8f90 100644 --- a/aana/deployments/whisper_deployment.py +++ b/aana/deployments/whisper_deployment.py @@ -1,4 +1,4 @@ -from collections.abc import AsyncGenerator +from collections.abc import AsyncGenerator # noqa: I001 from enum import Enum from typing import Any, cast @@ -20,6 +20,16 @@ from aana.deployments.base_deployment import BaseDeployment, exception_handler from aana.exceptions.runtime import InferenceException +# Workaround for CUDNN issue with cTranslate2: +import os +import nvidia.cudnn.lib +from pathlib import Path + +cudnn_path = str(Path(nvidia.cudnn.lib.__file__).parent) +os.environ["LD_LIBRARY_PATH"] = ( + cudnn_path + "/:" + os.environ.get("LD_LIBRARY_PATH", "") +) + class WhisperComputeType(str, Enum): """The data type used by whisper models.