|
| 1 | +/* |
| 2 | +Copyright 2024-2025 The Spice.ai OSS Authors |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +use crate::parameters::ParameterSpec; |
| 18 | + |
| 19 | +const MODEL2VEC_PARAM_LEN: usize = 6; |
| 20 | + |
| 21 | +pub const PARAMETERS: &[ParameterSpec] = &MODEL2VEC_PARAMETERS; |
| 22 | + |
| 23 | +pub(crate) const MODEL2VEC_PARAMETERS: [ParameterSpec; MODEL2VEC_PARAM_LEN] = [ |
| 24 | + ParameterSpec::component("hf_token") |
| 25 | + .secret() |
| 26 | + .description("The Hugging Face access token."), |
| 27 | + ParameterSpec::component("subfolder") |
| 28 | + .description("The subfolder within the Hugging Face repo containing the model."), |
| 29 | + ParameterSpec::component("normalize") |
| 30 | + .description("Whether to normalize the embedding output.") |
| 31 | + .one_of(&["true", "false"]), |
| 32 | + ParameterSpec::runtime("parallelism") |
| 33 | + .description("The number of threads to use for parallel inference."), |
| 34 | + ParameterSpec::runtime("embed_max_token_length") |
| 35 | + .description("The maximum token length for embedding input."), |
| 36 | + ParameterSpec::runtime("embed_custom_batch_size") |
| 37 | + .description("The custom batch size for embedding inference."), |
| 38 | +]; |
0 commit comments