Fedir Zadniprovskyi 2024-08-27
chore: expose additional config options (#51) pt2
@55761d5e6dac7986e443f2f84ea8f48e2101a028
faster_whisper_server/config.py
--- faster_whisper_server/config.py
+++ faster_whisper_server/config.py
@@ -156,9 +156,9 @@
     You can find other supported models at https://huggingface.co/models?p=2&sort=trending&search=ctranslate2 and https://huggingface.co/models?sort=trending&search=ct2
     """
     inference_device: Device = Field(default=Device.AUTO)
-    compute_type: Quantization = Field(default=Quantization.DEFAULT)
     device_index: int | list[int] = 0
-    cpu_threads: int = 16
+    compute_type: Quantization = Field(default=Quantization.DEFAULT)
+    cpu_threads: int = 0
     num_workers: int = 1
 
 
faster_whisper_server/main.py
--- faster_whisper_server/main.py
+++ faster_whisper_server/main.py
@@ -67,7 +67,10 @@
     whisper = WhisperModel(
         model_name,
         device=config.whisper.inference_device,
+        device_index=config.whisper.device_index,
         compute_type=config.whisper.compute_type,
+        cpu_threads=config.whisper.cpu_threads,
+        num_workers=config.whisper.num_workers,
     )
     logger.info(
         f"Loaded {model_name} loaded in {time.perf_counter() - start:.2f} seconds. {config.whisper.inference_device}({config.whisper.compute_type}) will be used for inference."  # noqa: E501
Add a comment
List