mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-19 16:15:04 +00:00
Test pass!
Payload delivered and picked up. Need to ensure the job now runs locally.
This commit is contained in:
1 parent
54e9b8af70
commit
a485666b1c
3 files changed
+4
-10
No files matched your search
+1
-4
@@ -147,14 +147,11 @@ mod tests {
|
||||
assert!(json.len() < 1000);
|
||||
}
|
||||
|
||||
|
||||
// TODO FIX THIS TEST! MICHAEL
|
||||
#[test]
|
||||
fn typical_tts_args_serialize() {
|
||||
let args = GenericInferenceArgs {
|
||||
inference_category: Some(InferenceCategoryAbbreviated::TextToSpeech),
|
||||
args: Some(PolymorphicInferenceArgs::Tts(TTSArgs {
|
||||
text: "hello world".to_string(),
|
||||
voice_token: "token".to_string(),
|
||||
})),
|
||||
};
|
||||
@@ -162,7 +159,7 @@ mod tests {
|
||||
let json = serde_json::ser::to_string(&args).unwrap();
|
||||
|
||||
// NB: Assert the serialized form. If this changes and the test breaks, be careful about migrating.
|
||||
assert_eq!(json, r#"{"cat":"tts","args":{"Tts":{"t":"hello world","e":"token"}}}"#.to_string());
|
||||
assert_eq!(json, r#"{"cat":"tts","args":{"Tts":{"e":"token"}}}"#.to_string());
|
||||
|
||||
// NB: Make sure we don't overflow the DB field capacity (TEXT column).
|
||||
assert!(json.len() < 1000);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
|
||||
pub struct TTSArgs {
|
||||
#[serde(rename = "t")]
|
||||
pub text: String,
|
||||
#[serde(rename = "e")]
|
||||
pub voice_token: String // varchar 32
|
||||
}
|
||||
|
||||
+3
-4
@@ -127,7 +127,6 @@ let ip_address = get_request_ip(&http_request);
|
||||
|
||||
// package as larger component args should always have an embedding token ..
|
||||
let inference_args = TTSArgs {
|
||||
text: request.text.clone(),
|
||||
voice_token: request.voice_token.clone()
|
||||
};
|
||||
|
||||
@@ -139,9 +138,9 @@ let query_result = insert_generic_inference_job(InsertGenericInferenceArgs {
|
||||
inference_category: InferenceCategory::TextToSpeech,
|
||||
maybe_model_type: Some(InferenceModelType::VallEX), // NB: Model is static during inference
|
||||
maybe_model_token: None, // NB: Model is static during inference
|
||||
maybe_input_source_token: None, // TODO: Introduce a second foreign key ?
|
||||
maybe_input_source_token_type: None, // TODO: Introduce a second foreign key ?
|
||||
maybe_raw_inference_text: None, // No text
|
||||
maybe_input_source_token: None,
|
||||
maybe_input_source_token_type: None,
|
||||
maybe_raw_inference_text: Some(&request.text),
|
||||
maybe_inference_args: Some(GenericInferenceArgs {
|
||||
inference_category: Some(InferenceCategoryAbbreviated::TextToSpeech),
|
||||
args: Some(PolymorphicInferenceArgs::Tts(inference_args)),
|
||||
|
||||
Reference in new issue
Block a user