mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-01 07:58:23 +00:00
provide reference language
This commit is contained in:
1 parent
9d3984e071
commit
c803be4ed4
2 files changed
+12
-2
No files matched your search
+8
-1
@@ -51,13 +51,16 @@ pub struct InferenceArgs<'s> {
|
||||
pub input_text_file: &'s Path,
|
||||
pub gpt_model_path: &'s Path,
|
||||
pub sovits_model_path: &'s Path,
|
||||
|
||||
pub reference_audio_path: Option<&'s Path>,
|
||||
pub reference_transcript_path: Option<&'s Path>,
|
||||
pub reference_language : Option<&'s str>,
|
||||
|
||||
pub output_audio_directory: &'s Path,
|
||||
|
||||
pub maybe_reference_free: Option<bool>,
|
||||
pub maybe_temperature: Option<f32>,
|
||||
pub maybe_target_language: Option<String>,
|
||||
pub maybe_target_language: Option<&'s str>,
|
||||
}
|
||||
|
||||
impl GptSovitsInferenceCommand {
|
||||
@@ -161,6 +164,10 @@ impl GptSovitsInferenceCommand {
|
||||
if let Some(reference_transcript_path) = args.reference_transcript_path {
|
||||
command.push_str(&format!(" --ref_text {}", path_to_string(reference_transcript_path)));
|
||||
}
|
||||
|
||||
if let Some(ref_language) = args.reference_language {
|
||||
command.push_str(&format!(" --ref_language {}", ref_language));
|
||||
}
|
||||
}
|
||||
|
||||
command.push_str(&format!(" --output_path {}", path_to_string(args.output_audio_directory)));
|
||||
|
||||
+4
-1
@@ -109,6 +109,8 @@ pub async fn process_single_gpt_sovits_tts_job(
|
||||
_ => (None, None),
|
||||
};
|
||||
|
||||
const DEFAULT_LANGUAGE : &str = "english";
|
||||
|
||||
let inference_start_time = Instant::now();
|
||||
|
||||
let command_exit_status = gpt_sovits_deps
|
||||
@@ -121,10 +123,11 @@ pub async fn process_single_gpt_sovits_tts_job(
|
||||
sovits_model_path: &sovits_model_path,
|
||||
reference_audio_path: reference_audio_path.as_deref(),
|
||||
reference_transcript_path: reference_transcript_path.as_deref(),
|
||||
reference_language: Some(DEFAULT_LANGUAGE),
|
||||
output_audio_directory: &output_dir,
|
||||
maybe_reference_free: None,
|
||||
maybe_temperature: None,
|
||||
maybe_target_language: Some("english".to_string()),
|
||||
maybe_target_language: Some(DEFAULT_LANGUAGE),
|
||||
});
|
||||
|
||||
let inference_duration = Instant::now().duration_since(inference_start_time);
|
||||
|
||||
Reference in new issue
Block a user