mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 12:24:53 +00:00
fix tests
This commit is contained in:
parent
07a3050b20
commit
93e7ba54c0
@ -48,13 +48,13 @@ pub struct HubModelInfo {
|
|||||||
pub pipeline_tag: Option<String>,
|
pub pipeline_tag: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize)]
|
#[derive(Debug, Clone, Deserialize, PartialEq)]
|
||||||
pub struct ChatTemplate {
|
pub struct ChatTemplate {
|
||||||
name: String,
|
name: String,
|
||||||
template: String,
|
template: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize)]
|
#[derive(Debug, Clone, Deserialize, PartialEq)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum ChatTemplateVersions {
|
pub enum ChatTemplateVersions {
|
||||||
Single(String),
|
Single(String),
|
||||||
@ -990,7 +990,10 @@ mod tests {
|
|||||||
let config: HubTokenizerConfig = serde_json::from_str(json_content).unwrap();
|
let config: HubTokenizerConfig = serde_json::from_str(json_content).unwrap();
|
||||||
|
|
||||||
// check that we successfully parsed the tokens
|
// check that we successfully parsed the tokens
|
||||||
assert_eq!(config.chat_template, Some("test".to_string()));
|
assert_eq!(
|
||||||
|
config.chat_template,
|
||||||
|
Some(ChatTemplateVersions::Single("test".to_string()))
|
||||||
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
config.bos_token,
|
config.bos_token,
|
||||||
Some("<|begin▁of▁sentence|>".to_string())
|
Some("<|begin▁of▁sentence|>".to_string())
|
||||||
@ -1022,7 +1025,10 @@ mod tests {
|
|||||||
let config: HubTokenizerConfig = serde_json::from_str(json_content).unwrap();
|
let config: HubTokenizerConfig = serde_json::from_str(json_content).unwrap();
|
||||||
|
|
||||||
// check that we successfully parsed the tokens
|
// check that we successfully parsed the tokens
|
||||||
assert_eq!(config.chat_template, Some("test".to_string()));
|
assert_eq!(
|
||||||
|
config.chat_template,
|
||||||
|
Some(ChatTemplateVersions::Single("test".to_string()))
|
||||||
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
config.bos_token,
|
config.bos_token,
|
||||||
Some("<|begin▁of▁sentence|>".to_string())
|
Some("<|begin▁of▁sentence|>".to_string())
|
||||||
|
Loading…
Reference in New Issue
Block a user