Skip to content

Commit

Permalink
feat(constants): update model constants (#17)
Browse files Browse the repository at this point in the history
* feat(Model)!: Update model constants

- Add new models Mistral Nemo and Codestral Mamba
- Add aliases to models constant to be deserialized seemlessly from the versioned forme (e.g.: "mistral-large-2407")
- The commonly named Mistral Large 2 is now `constants::Model::MistralLargeLatest` when the old one is `Model::MistralLarge`

* tests(Model): Update the tests to check the new model variants.
  • Loading branch information
francois-caddet authored Aug 27, 2024
1 parent 79a410b commit 161b33c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/v1/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@ pub enum Model {
OpenMixtral8x7b,
#[serde(rename = "open-mixtral-8x22b")]
OpenMixtral8x22b,
#[serde(rename = "open-mistral-nemo", alias = "open-mistral-nemo-2407")]
OpenMistralNemo,
#[serde(rename = "mistral-tiny")]
MistralTiny,
#[serde(rename = "mistral-small-latest")]
#[serde(rename = "mistral-small-latest", alias = "mistral-small-2402")]
MistralSmallLatest,
#[serde(rename = "mistral-medium-latest")]
#[serde(rename = "mistral-medium-latest", alias = "mistral-medium-2312")]
MistralMediumLatest,
#[serde(rename = "mistral-large-latest")]
#[serde(rename = "mistral-large-latest", alias = "mistral-large-2407")]
MistralLargeLatest,
#[serde(rename = "codestral-latest")]
#[serde(rename = "mistral-large-2402")]
MistralLarge,
#[serde(rename = "codestral-latest", alias = "codestral-2405")]
CodestralLatest,
#[serde(rename = "open-codestral-mamba")]
CodestralMamba,
}

#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
Expand Down
3 changes: 3 additions & 0 deletions tests/v1_constants_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ fn test_model_constant() {
Model::OpenMistral7b,
Model::OpenMixtral8x7b,
Model::OpenMixtral8x22b,
Model::OpenMistralNemo,
Model::MistralTiny,
Model::MistralSmallLatest,
Model::MistralMediumLatest,
Model::MistralLargeLatest,
Model::MistralLarge,
Model::CodestralLatest,
Model::CodestralMamba,
];

let client = Client::new(None, None, None, None).unwrap();
Expand Down

0 comments on commit 161b33c

Please sign in to comment.