mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 21:50:28 +02:00
Implement LLM client and normalization settings
- Added LLMClient class for handling requests to LLM API, including methods for listing models and generating completions. - Introduced LLMConfiguration dataclass for managing LLM configuration settings. - Created normalization_settings module to manage normalization configurations and environment variable overrides. - Developed JavaScript functionality for the settings interface, including model fetching and preview generation for LLM and normalization. - Enhanced user experience with status messages and error handling in the settings UI.
This commit is contained in:
+4
-1
@@ -7,6 +7,7 @@ from typing import Pattern
|
||||
import re
|
||||
|
||||
from abogen.kokoro_text_normalization import ApostropheConfig, normalize_for_pipeline
|
||||
from abogen.normalization_settings import build_apostrophe_config, get_runtime_settings
|
||||
|
||||
ChunkLevel = Literal["paragraph", "sentence"]
|
||||
|
||||
@@ -78,7 +79,9 @@ def _normalize_whitespace(value: str) -> str:
|
||||
|
||||
|
||||
def _normalize_chunk_text(value: str) -> str:
|
||||
normalized = normalize_for_pipeline(value, config=_PIPELINE_APOSTROPHE_CONFIG)
|
||||
settings = get_runtime_settings()
|
||||
config = build_apostrophe_config(settings=settings, base=_PIPELINE_APOSTROPHE_CONFIG)
|
||||
normalized = normalize_for_pipeline(value, config=config, settings=settings)
|
||||
return _normalize_whitespace(normalized)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user