# Copyright (c) 2024, NVIDIA CORPORATION.  All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "whisper_tensorrt_llm_cpprunner"
backend: "python"
max_batch_size: ${triton_max_batch_size}

dynamic_batching {
    max_queue_delay_microseconds: ${max_queue_delay_microseconds}
}

parameters [
  {
    key: "engine_dir"
    value: { string_value: "${engine_dir}"}
  },
  {
   key: "n_mels", 
   value: {string_value:"${n_mels}"} # 128 dim for large-v3, 80 dim for large-v2
  },
  {
  key: "zero_pad"
  value: {string_value: "${zero_pad}"}
  },
  {
    key: "mel_filters_dir"
    value: { string_value: "${mel_filters_dir}"}
  }
]

input [
  {
    name: "WAV"
    data_type: TYPE_FP32
    dims: [-1]
    optional: True
  },
  {
    name: "WAV_LEN"
    data_type: TYPE_INT32
    dims: [1]
    optional: True
  },
  {
    name: "DECODER_INPUT_IDS"
    data_type: TYPE_INT32
    dims: [-1]
    optional: True
  }
]
output [
  {
    name: "OUTPUT_IDS"
    data_type: TYPE_INT32
    dims: [-1]
  }
]

parameters: {
  key: "cross_kv_cache_fraction"
  value: {
    string_value: "${cross_kv_cache_fraction}"
  }
}
parameters: {
  key: "kv_cache_free_gpu_mem_fraction"
  value: {
    string_value: "${kv_cache_free_gpu_mem_fraction}"
  }
}


instance_group [
  {
    count: 1
    kind: KIND_GPU
  }
]