hasanbasbunar commited on
Commit
5894a64
·
1 Parent(s): 9f93873

feat: enable native XTTS splitting by default for better AI compatibility

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1052,9 +1052,13 @@ def synthesize_speech(
1052
  else:
1053
  return None, "Error: No audio segment could be generated", preprocessed_text
1054
  else:
1055
- use_native_splitting = text_splitting_method == "Native XTTS splitting"
1056
- if len(preprocessed_text) > 150 and not use_native_splitting:
1057
- print("Long text detected: enabling native XTTS splitting to avoid truncation")
 
 
 
 
1058
  use_native_splitting = True
1059
 
1060
  print(f"Generating with parameters: temperature={temperature}, do_sample={do_sample}, repetition_penalty={repetition_penalty}, length_penalty={length_penalty}, top_k={top_k}, top_p={top_p}, enable_text_splitting={use_native_splitting}")
 
1052
  else:
1053
  return None, "Error: No audio segment could be generated", preprocessed_text
1054
  else:
1055
+ # Always enable native XTTS splitting by default for better AI agent compatibility
1056
+ use_native_splitting = True
1057
+ if text_splitting_method == "No splitting":
1058
+ use_native_splitting = False
1059
+ print("Native XTTS splitting disabled by user request")
1060
+ elif len(preprocessed_text) > 150:
1061
+ print("Long text detected: native XTTS splitting is enabled")
1062
  use_native_splitting = True
1063
 
1064
  print(f"Generating with parameters: temperature={temperature}, do_sample={do_sample}, repetition_penalty={repetition_penalty}, length_penalty={length_penalty}, top_k={top_k}, top_p={top_p}, enable_text_splitting={use_native_splitting}")