

chore: expose additional config options (#51) pt2
@55761d5e6dac7986e443f2f84ea8f48e2101a028
--- faster_whisper_server/config.py
+++ faster_whisper_server/config.py
... | ... | @@ -156,9 +156,9 @@ |
156 | 156 |
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 |
157 | 157 |
""" |
158 | 158 |
inference_device: Device = Field(default=Device.AUTO) |
159 |
- compute_type: Quantization = Field(default=Quantization.DEFAULT) |
|
160 | 159 |
device_index: int | list[int] = 0 |
161 |
- cpu_threads: int = 16 |
|
160 |
+ compute_type: Quantization = Field(default=Quantization.DEFAULT) |
|
161 |
+ cpu_threads: int = 0 |
|
162 | 162 |
num_workers: int = 1 |
163 | 163 |
|
164 | 164 |
|
--- faster_whisper_server/main.py
+++ faster_whisper_server/main.py
... | ... | @@ -67,7 +67,10 @@ |
67 | 67 |
whisper = WhisperModel( |
68 | 68 |
model_name, |
69 | 69 |
device=config.whisper.inference_device, |
70 |
+ device_index=config.whisper.device_index, |
|
70 | 71 |
compute_type=config.whisper.compute_type, |
72 |
+ cpu_threads=config.whisper.cpu_threads, |
|
73 |
+ num_workers=config.whisper.num_workers, |
|
71 | 74 |
) |
72 | 75 |
logger.info( |
73 | 76 |
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
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?