Fixed post-processing for chinese (#628)
This commit is contained in:
parent
cc129e9105
commit
c45df96065
1 changed files with 10 additions and 6 deletions
|
|
@ -340,15 +340,16 @@ impl ShortcutAction for TranscribeAction {
|
||||||
if let Some(converted_text) =
|
if let Some(converted_text) =
|
||||||
maybe_convert_chinese_variant(&settings, &transcription).await
|
maybe_convert_chinese_variant(&settings, &transcription).await
|
||||||
{
|
{
|
||||||
final_text = converted_text.clone();
|
final_text = converted_text;
|
||||||
post_processed_text = Some(converted_text);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then apply regular post-processing if enabled
|
// Then apply regular post-processing if enabled
|
||||||
else if let Some(processed_text) =
|
// Uses final_text which may already have Chinese conversion applied
|
||||||
maybe_post_process_transcription(&settings, &transcription).await
|
if let Some(processed_text) =
|
||||||
|
maybe_post_process_transcription(&settings, &final_text).await
|
||||||
{
|
{
|
||||||
final_text = processed_text.clone();
|
post_processed_text = Some(processed_text.clone());
|
||||||
post_processed_text = Some(processed_text);
|
final_text = processed_text;
|
||||||
|
|
||||||
// Get the prompt that was used
|
// Get the prompt that was used
|
||||||
if let Some(prompt_id) = &settings.post_process_selected_prompt_id {
|
if let Some(prompt_id) = &settings.post_process_selected_prompt_id {
|
||||||
|
|
@ -360,6 +361,9 @@ impl ShortcutAction for TranscribeAction {
|
||||||
post_process_prompt = Some(prompt.prompt.clone());
|
post_process_prompt = Some(prompt.prompt.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if final_text != transcription {
|
||||||
|
// Chinese conversion was applied but no LLM post-processing
|
||||||
|
post_processed_text = Some(final_text.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save to history with post-processed text and prompt
|
// Save to history with post-processed text and prompt
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue