diff options
Diffstat (limited to 'converter/converter.py')
| -rw-r--r-- | converter/converter.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/converter/converter.py b/converter/converter.py index e36face..4422316 100644 --- a/converter/converter.py +++ b/converter/converter.py @@ -15,6 +15,7 @@ from typing import Dict, List, Optional, Tuple from . import audio, chunking, config, cover, extractors from .audio import TrackMeta from .tts import ( + MODEL_SIZE, VOICE_MODE_CLONE, VOICE_MODE_CUSTOM, VOICE_MODES, @@ -435,14 +436,12 @@ class AudiobookConverter: logger.info("Extracted %d characters (%d words)", len(text), len(text.split())) - # Split into chunks chunks = chunking.split_into_chunks(text) total_chunks = len(chunks) if total_chunks == 0: logger.error("No chunks created") return False - # Log chunk info chunk_sizes = [len(chunk.split()) for chunk in chunks] avg_chunk_size = sum(chunk_sizes) / len(chunk_sizes) logger.info("Split into %d chunks (avg %.0f words per chunk)", total_chunks, avg_chunk_size) @@ -460,7 +459,6 @@ class AudiobookConverter: logger.warning("Only %d/%d chunks succeeded. Proceeding with partial audiobook.", successful_chunks, total_chunks) - # Combine chunks (only the successful ones) success = audio.combine_chunks(total_chunks, output_path, chunk_results=results, speed=speed, output_format=output_format, intermediate=chapter is not None, @@ -504,7 +502,7 @@ class AudiobookConverter: else config.QWEN_API_URL) print(f"Qwen API endpoint: {api_url}") print(f"Voice mode: {self.voice_mode}") - print("Model size: 1.7B (always)") + print(f"Model size: {MODEL_SIZE} (always)") if self.voice_mode == VOICE_MODE_CUSTOM: print(f"Speaker: {config.SPEAKER}") print(f"Language: {self.language}") @@ -525,7 +523,6 @@ class AudiobookConverter: run_start = time.time() self._print_banner() - # Check for books book_files = sorted( f for f in BOOKS_FOLDER.iterdir() if f.is_file() and f.suffix.lower() in SUPPORTED_FORMATS @@ -571,7 +568,6 @@ class AudiobookConverter: print(f"[INFO] Converting {len(planned)} of {len(book_files)} book(s)") - # Convert each book results = {} for book_file, output_name in planned: try: @@ -585,7 +581,6 @@ class AudiobookConverter: logger.error("Unexpected error: %s", exc) results[book_file.name] = False - # Print summary successful = sum(results.values()) total = len(results) |
