mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 21:50:28 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56f81ef892 | ||
|
|
968c673e58 | ||
|
|
174ff4232f | ||
|
|
c43659005e | ||
|
|
e3cdd1a9ca | ||
|
|
ed31aaf632 | ||
|
|
0820c40b14 | ||
|
|
0ac2810515 | ||
|
|
1c3fd9e4cf | ||
|
|
e96c19ace6 | ||
|
|
4e678c7e13 | ||
|
|
7ee40d6aca |
@@ -0,0 +1 @@
|
||||
3.12
|
||||
@@ -1,3 +1,12 @@
|
||||
# 1.2.5
|
||||
- Added new option: `Override item settings with current selection` in the queue manager. When enabled, all items in the queue will be processed using the current global settings selected in the main GUI, overriding their individual settings. When disabled, each item will retain its own specific settings.
|
||||
- Fixed `Error "Could not load the Qt platform plugin "xcb"` error that occurred in some Linux distributions due to missing `libxcb-cursor0` library by conditionally loading the bundled library when the system version is unavailable, issue mentioned by @bmcgonag in #101.
|
||||
- Fixed the `No module named pip` error that occurred for users who installed Abogen via the [**uv**](https://github.com/astral-sh/uv) installer.
|
||||
- Fixed defaults for `replace_single_newlines` not being applied correctly in some cases.
|
||||
- Fixed `Save chapters separately for queued epubs is ignored`, issue mentioned by @dymas-cz in #109.
|
||||
- Fixed incorrect sentence segmentation when using spaCy, where text would erroneously split after opening parentheses.
|
||||
- Improvements in code and documentation.
|
||||
|
||||
# 1.2.4
|
||||
- **Subtitle generation is now available for all languages!** Abogen now supports subtitle generation for non-English languages using audio duration-based timing. Available modes include `Line`, `Sentence`, and `Sentence + Comma`. (Note: Word-level subtitle modes remain English-only due to Kokoro's timestamp token limitations.)
|
||||
- New option: **"Use spaCy for sentence segmentation"** You can now use [spaCy](https://spacy.io/) to automatically detect sentence boundaries and produce cleaner, more readable subtitles. Quick summary:
|
||||
|
||||
@@ -21,10 +21,10 @@ https://github.com/user-attachments/assets/094ba3df-7d66-494a-bc31-0e4b41d0b865
|
||||
|
||||
## `How to install?` <a href="https://pypi.org/project/abogen/" target="_blank"><img src="https://img.shields.io/pypi/pyversions/abogen" alt="Abogen Compatible PyPi Python Versions" align="right" style="margin-top:6px;"></a>
|
||||
|
||||
### Windows
|
||||
### `Windows`
|
||||
Go to [espeak-ng latest release](https://github.com/espeak-ng/espeak-ng/releases/latest) download and run the *.msi file.
|
||||
|
||||
#### OPTION 1: Install using script
|
||||
#### <b>OPTION 1: Install using script</b>
|
||||
1. [Download](https://github.com/denizsafak/abogen/archive/refs/heads/main.zip) the repository
|
||||
2. Extract the ZIP file
|
||||
3. Run `WINDOWS_INSTALL.bat` by double-clicking it
|
||||
@@ -34,7 +34,26 @@ This method handles everything automatically - installing all dependencies inclu
|
||||
> [!NOTE]
|
||||
> You don't need to install Python separately. The script will install Python automatically.
|
||||
|
||||
#### OPTION 2: Install using pip
|
||||
#### <b>OPTION 2: Install using uv</b>
|
||||
First, [install uv](https://docs.astral.sh/uv/getting-started/installation/) if you haven't already.
|
||||
|
||||
```bash
|
||||
# For NVIDIA GPUs (CUDA 12.8) - Recommended
|
||||
uv tool install --python 3.12 abogen[cuda]
|
||||
|
||||
# For NVIDIA GPUs (CUDA 12.6) - Older drivers
|
||||
uv tool install --python 3.12 abogen[cuda126]
|
||||
|
||||
# For NVIDIA GPUs (CUDA 13.0) - Newer drivers
|
||||
uv tool install --python 3.12 abogen[cuda130]
|
||||
|
||||
# For AMD GPUs or without GPU (CPU) - ROCm is not available on Windows. Use Linux if you have AMD GPU
|
||||
uv tool install --python 3.12 abogen
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary><b>Alternative: Install using pip (click to expand)</b></summary>
|
||||
|
||||
```bash
|
||||
# Create a virtual environment (optional)
|
||||
mkdir abogen && cd abogen
|
||||
@@ -52,7 +71,23 @@ pip install torch==2.8.0+cu128 torchvision==0.23.0+cu128 torchaudio==2.8.0 --ind
|
||||
pip install abogen
|
||||
```
|
||||
|
||||
### Mac
|
||||
</details>
|
||||
|
||||
### `Mac`
|
||||
|
||||
First, [install uv](https://docs.astral.sh/uv/getting-started/installation/) if you haven't already.
|
||||
|
||||
```bash
|
||||
# Install espeak-ng
|
||||
brew install espeak-ng
|
||||
|
||||
# Install abogen (Automatically handles Silicon Mac/MPS support)
|
||||
uv tool install --python 3.12 abogen
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary><b>Alternative: Install using pip (click to expand)</b></summary>
|
||||
|
||||
```bash
|
||||
# Install espeak-ng
|
||||
brew install espeak-ng
|
||||
@@ -69,7 +104,29 @@ pip3 install abogen
|
||||
# After installing abogen, we need to install Kokoro's development version which includes MPS support.
|
||||
pip3 install git+https://github.com/hexgrad/kokoro.git
|
||||
```
|
||||
### Linux
|
||||
|
||||
</details>
|
||||
|
||||
### `Linux`
|
||||
|
||||
First, [install uv](https://docs.astral.sh/uv/getting-started/installation/) if you haven't already.
|
||||
|
||||
```bash
|
||||
# Install espeak-ng
|
||||
sudo apt install espeak-ng # Ubuntu/Debian
|
||||
sudo pacman -S espeak-ng # Arch Linux
|
||||
sudo dnf install espeak-ng # Fedora
|
||||
|
||||
# For NVIDIA GPUs or without GPU (CPU) - No need to include [CUDA] in here.
|
||||
uv tool install --python 3.12 abogen
|
||||
|
||||
# For AMD GPUs (ROCm 6.4)
|
||||
uv tool install --python 3.12 abogen[rocm]
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary><b>Alternative: Install using pip (click to expand)</b></summary>
|
||||
|
||||
```bash
|
||||
# Install espeak-ng
|
||||
sudo apt install espeak-ng # Ubuntu/Debian
|
||||
@@ -92,6 +149,8 @@ pip3 install abogen
|
||||
pip3 uninstall torch
|
||||
pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.4
|
||||
```
|
||||
</details>
|
||||
|
||||
|
||||
> See [How to fix "CUDA GPU is not available. Using CPU" warning?](#cuda-warning)
|
||||
|
||||
@@ -101,12 +160,11 @@ pip3 install --pre torch torchvision torchaudio --index-url https://download.pyt
|
||||
|
||||
> See [How to fix "[WinError 1114] A dynamic link library (DLL) initialization routine failed" error?](#WinError-1114)
|
||||
|
||||
> See [How to use "uv" instead of "pip"?](#use-uv-instead-of-pip)
|
||||
|
||||
> Special thanks to [@hg000125](https://github.com/hg000125) for his contribution in [#23](https://github.com/denizsafak/abogen/issues/23). AMD GPU support is possible thanks to his work.
|
||||
|
||||
## `How to run?`
|
||||
If you installed using pip, you can simply run the following command to start Abogen:
|
||||
|
||||
You can simply run this command to start Abogen:
|
||||
|
||||
```bash
|
||||
abogen
|
||||
@@ -191,8 +249,9 @@ With voice mixer, you can create custom voices by mixing different voice models.
|
||||
|
||||
Abogen supports **queue mode**, allowing you to add multiple files to a processing queue. This is useful if you want to convert several files in one batch.
|
||||
|
||||
- You can add text files (`.txt`) directly using the **Add files** button in the Queue Manager. To add PDF, EPUB, or markdown files, use the input box in the main window and click the **Add to Queue** button.
|
||||
- You can add text files (`.txt`) and subtitle files (`.srt`, `.ass`, `.vtt`) directly using the **Add files** button in the Queue Manager or by dragging and dropping them into the queue list. To add PDF, EPUB, or markdown files, use the input box in the main window and click the **Add to Queue** button.
|
||||
- Each file in the queue keeps the configuration settings that were active when it was added. Changing the main window configuration afterward does **not** affect files already in the queue.
|
||||
- You can enable the **Override item settings with current selection** option to force all items in the queue to use the configuration currently selected in the main window, overriding their saved settings.
|
||||
- You can view each file's configuration by hovering over them.
|
||||
|
||||
Abogen will process each item in the queue automatically, saving outputs as configured.
|
||||
@@ -327,6 +386,17 @@ Known issues:
|
||||
|
||||
> Special thanks to [@geo38](https://www.reddit.com/user/geo38/) from Reddit, who provided the Dockerfile and instructions in [this comment](https://www.reddit.com/r/selfhosted/comments/1k8x1yo/comment/mpe0bz8/).
|
||||
|
||||
## `🌐 Web Application`
|
||||
|
||||
A web-based version of Abogen has been developed by [@jeremiahsb](https://github.com/jeremiahsb).
|
||||
|
||||
**Access the repository here:** [jeremiahsb/abogen](https://github.com/jeremiahsb/abogen)
|
||||
|
||||
> [!NOTE]
|
||||
> I intend to merge this implementation into the main repository in the future once existing conflicts are resolved. Until then, please be aware that the web version is maintained independently and may not always be in sync with the latest updates in this repository.
|
||||
|
||||
> Special thanks to [@jeremiahsb](https://github.com/jeremiahsb) for implementing the web app!
|
||||
|
||||
## `Similar Projects`
|
||||
Abogen is a standalone project, but it is inspired by and shares some similarities with other projects. Here are a few:
|
||||
- [audiblez](https://github.com/santinic/audiblez): Generate audiobooks from e-books. **(Has CLI and GUI support)**
|
||||
@@ -388,6 +458,15 @@ This will start Abogen in command-line mode and display detailed error messages.
|
||||
> ```
|
||||
>
|
||||
> If you have an AMD GPU, you need to use Linux and follow the Linux/ROCm [instructions](#linux). If you want to keep running on CPU, no action is required, but performance will just be reduced. See [#32](https://github.com/denizsafak/abogen/issues/32) for more details.
|
||||
>
|
||||
> If you used `uv` to install Abogen, you can uninstall and try reinstalling with another CUDA version:
|
||||
> ```bash
|
||||
> uv tool uninstall abogen
|
||||
> # First, try CUDA 13.0 for newer drivers
|
||||
> uv tool install --python 3.12 abogen[cuda130]
|
||||
> # If that doesn't work, try CUDA 12.6 for older drivers
|
||||
> uv tool install --python 3.12 abogen[cuda126]
|
||||
> ```
|
||||
|
||||
</details>
|
||||
|
||||
@@ -406,7 +485,7 @@ This will start Abogen in command-line mode and display detailed error messages.
|
||||
<a name="no-matching-distribution-found">How to fix "No matching distribution found" error?<a>
|
||||
</b></summary>
|
||||
|
||||
> Try installing Abogen on supported Python (3.10 to 3.12) versions. You can use [pyenv](https://github.com/pyenv/pyenv) to manage multiple Python versions easily in Linux. Watch this [video](https://www.youtube.com/watch?v=MVyb-nI4KyI) by NetworkChuck for a quick guide.
|
||||
> Try installing Abogen on supported Python (3.10 to 3.12) versions. I recommend installing with [uv](https://docs.astral.sh/uv/getting-started/installation/). You can also use [pyenv](https://github.com/pyenv/pyenv) to manage multiple Python versions easily on Linux. Watch this [video](https://www.youtube.com/watch?v=MVyb-nI4KyI) by NetworkChuck for a quick guide.
|
||||
|
||||
</details>
|
||||
|
||||
@@ -435,18 +514,6 @@ This will start Abogen in command-line mode and display detailed error messages.
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><b>
|
||||
<a name="use-uv-instead-of-pip">How to use "uv" instead of "pip"?</a>
|
||||
</b></summary>
|
||||
|
||||
> Abogen needs "pip", because Kokoro uses pip to download voice models from HuggingFace Hub. If you want to use "uv" instead of "pip", you can use the following command to run Abogen:
|
||||
>
|
||||
> ```bash
|
||||
> uvx --with pip abogen
|
||||
> ```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><b>
|
||||
<a name="use-uv-instead-of-pip">How to uninstall Abogen?</a>
|
||||
</b></summary>
|
||||
@@ -458,6 +525,11 @@ This will start Abogen in command-line mode and display detailed error messages.
|
||||
>pip uninstall abogen # uninstalls abogen
|
||||
>pip cache purge # removes pip cache
|
||||
>```
|
||||
>- If you installed Abogen using uv, type:
|
||||
>```bash
|
||||
>uv tool uninstall abogen # uninstalls abogen
|
||||
>uv cache clear # removes uv cache
|
||||
>```
|
||||
> - If you installed Abogen using the Windows installer (WINDOWS_INSTALL.bat), just remove the folder that contains Abogen. It installs everything inside `python_embedded` folder, no other directories are created.
|
||||
> - If you installed espeak-ng, you need to remove it separately.
|
||||
|
||||
@@ -465,6 +537,7 @@ This will start Abogen in command-line mode and display detailed error messages.
|
||||
|
||||
## `Contributing`
|
||||
I welcome contributions! If you have ideas for new features, improvements, or bug fixes, please fork the repository and submit a pull request.
|
||||
|
||||
### For developers and contributors
|
||||
If you'd like to modify the code and contribute to development, you can [download the repository](https://github.com/denizsafak/abogen/archive/refs/heads/main.zip), extract it and run the following commands to build **or** install the package:
|
||||
```bash
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.2.4
|
||||
1.2.5
|
||||
@@ -390,7 +390,7 @@ class HandlerDialog(QDialog):
|
||||
from abogen.utils import load_config
|
||||
|
||||
cfg = load_config()
|
||||
replace_single_newlines = cfg.get("replace_single_newlines", False)
|
||||
replace_single_newlines = cfg.get("replace_single_newlines", True)
|
||||
|
||||
cache_key = (self.book_path, mod_time, self.file_type, replace_single_newlines)
|
||||
|
||||
|
||||
@@ -2042,7 +2042,7 @@ class ConversionThread(QThread):
|
||||
return
|
||||
|
||||
# Process text and timing
|
||||
replace_nl = getattr(self, "replace_single_newlines", False)
|
||||
replace_nl = getattr(self, "replace_single_newlines", True)
|
||||
processed_text = text.replace("\n", " ") if replace_nl else text
|
||||
use_gaps = getattr(self, "use_silent_gaps", False)
|
||||
next_start = (
|
||||
|
||||
+125
-22
@@ -1912,7 +1912,7 @@ class abogen(QWidget):
|
||||
and queued_item.output_folder == item_queue.output_folder
|
||||
and queued_item.subtitle_mode == item_queue.subtitle_mode
|
||||
and queued_item.output_format == item_queue.output_format
|
||||
and getattr(queued_item, "replace_single_newlines", False)
|
||||
and getattr(queued_item, "replace_single_newlines", True)
|
||||
== item_queue.replace_single_newlines
|
||||
and getattr(queued_item, "save_base_path", None)
|
||||
== item_queue.save_base_path
|
||||
@@ -1952,6 +1952,11 @@ class abogen(QWidget):
|
||||
dialog = QueueManager(self, self.queued_items)
|
||||
if dialog.exec() == QDialog.DialogCode.Accepted:
|
||||
self.queued_items = dialog.get_queue()
|
||||
|
||||
# Reload config to capture the new "Override" setting
|
||||
# The QueueManager writes to disk, so we must refresh our local copy
|
||||
self.config = load_config()
|
||||
|
||||
# re-enable/disable buttons based on queue state
|
||||
self.enable_disable_queue_buttons()
|
||||
|
||||
@@ -1967,23 +1972,62 @@ class abogen(QWidget):
|
||||
def start_next_queued_item(self):
|
||||
if self.current_queue_index < len(self.queued_items):
|
||||
queued_item = self.queued_items[self.current_queue_index]
|
||||
|
||||
self.selected_file = queued_item.file_name
|
||||
self.char_count = queued_item.total_char_count
|
||||
|
||||
# Restore the original file path for save location (Important for EPUB/PDF)
|
||||
self.displayed_file_path = (
|
||||
queued_item.save_base_path or queued_item.file_name
|
||||
)
|
||||
|
||||
# Restore chapter options (Structure specific, must be preserved)
|
||||
self.save_chapters_separately = getattr(
|
||||
queued_item, "save_chapters_separately", None
|
||||
)
|
||||
self.merge_chapters_at_end = getattr(
|
||||
queued_item, "merge_chapters_at_end", None
|
||||
)
|
||||
|
||||
# CHECK GLOBAL OVERRIDE SETTING
|
||||
if not self.config.get("queue_override_settings", False):
|
||||
self.selected_lang = queued_item.lang_code
|
||||
self.speed_slider.setValue(int(queued_item.speed * 100))
|
||||
|
||||
# Load the specific voice string
|
||||
self.selected_voice = queued_item.voice
|
||||
# Clear complex GUI states so the specific voice string is used
|
||||
self.mixed_voice_state = None
|
||||
self.selected_profile_name = None
|
||||
|
||||
self.save_option = queued_item.save_option
|
||||
self.selected_output_folder = queued_item.output_folder
|
||||
self.subtitle_mode = queued_item.subtitle_mode
|
||||
self.selected_format = queued_item.output_format
|
||||
self.char_count = queued_item.total_char_count
|
||||
self.replace_single_newlines = getattr(
|
||||
queued_item, "replace_single_newlines", False
|
||||
queued_item, "replace_single_newlines", True
|
||||
)
|
||||
self.use_silent_gaps = getattr(queued_item, "use_silent_gaps", False)
|
||||
# Restore the original file path for save location
|
||||
self.displayed_file_path = (
|
||||
queued_item.save_base_path or queued_item.file_name
|
||||
self.subtitle_speed_method = getattr(
|
||||
queued_item, "subtitle_speed_method", "tts"
|
||||
)
|
||||
|
||||
# This ensures that if conversion.py (or utils) reads from config/disk
|
||||
# instead of using passed arguments, it sees the correct queue values.
|
||||
self.config["replace_single_newlines"] = self.replace_single_newlines
|
||||
self.config["subtitle_mode"] = self.subtitle_mode
|
||||
self.config["selected_format"] = self.selected_format
|
||||
self.config["use_silent_gaps"] = self.use_silent_gaps
|
||||
self.config["subtitle_speed_method"] = self.subtitle_speed_method
|
||||
|
||||
# Sync Voice/Profile in config
|
||||
self.config["selected_voice"] = self.selected_voice
|
||||
if "selected_profile_name" in self.config:
|
||||
del self.config["selected_profile_name"]
|
||||
|
||||
# Note: Speed is already synced via self.speed_slider.setValue() -> update_speed_label()
|
||||
save_config(self.config)
|
||||
|
||||
self.start_conversion(from_queue=True)
|
||||
else:
|
||||
# Queue finished, reset index
|
||||
@@ -2181,36 +2225,95 @@ class abogen(QWidget):
|
||||
threading.Thread(target=gpu_and_load, daemon=True).start()
|
||||
|
||||
def show_queue_summary(self):
|
||||
"""Show a styled, resizable summary dialog after queue finishes."""
|
||||
"""Show a summary dialog after queue finishes."""
|
||||
if not self.queued_items:
|
||||
return
|
||||
|
||||
# Build HTML summary for better styling
|
||||
# Check if override was active (this determines which settings were ACTUALLY used)
|
||||
override_active = self.config.get("queue_override_settings", False)
|
||||
|
||||
# If override is ON, capture the global settings that were used for processing
|
||||
if override_active:
|
||||
g_voice = self.get_voice_formula()
|
||||
g_lang = self.get_selected_lang(g_voice)
|
||||
g_speed = self.speed_slider.value() / 100.0
|
||||
g_sub_mode = self.get_actual_subtitle_mode()
|
||||
g_format = self.selected_format
|
||||
g_newlines = self.replace_single_newlines
|
||||
g_silent_gaps = self.use_silent_gaps
|
||||
g_speed_method = self.subtitle_speed_method
|
||||
|
||||
# Build HTML summary (Default Styling)
|
||||
summary_html = "<html><body>"
|
||||
|
||||
header_text = "Queue finished"
|
||||
if override_active:
|
||||
header_text += " (Global Settings Applied)"
|
||||
|
||||
summary_html += (
|
||||
f"<h2 style='color:{COLORS['LIGHT_BG']};'>Queue finished</h2>"
|
||||
f"<h2>{header_text}</h2>"
|
||||
f"Processed {len(self.queued_items)} items:<br><br>"
|
||||
)
|
||||
|
||||
for idx, item in enumerate(self.queued_items, 1):
|
||||
output = getattr(item, "output_path", None)
|
||||
if not output:
|
||||
output = "Unknown"
|
||||
# Resolve Effective Settings
|
||||
if override_active:
|
||||
eff_lang = g_lang
|
||||
eff_voice = g_voice
|
||||
eff_speed = g_speed
|
||||
eff_sub_mode = g_sub_mode
|
||||
eff_format = g_format
|
||||
eff_newlines = g_newlines
|
||||
eff_silent = g_silent_gaps
|
||||
eff_method = g_speed_method
|
||||
else:
|
||||
eff_lang = item.lang_code
|
||||
eff_voice = item.voice
|
||||
eff_speed = item.speed
|
||||
eff_sub_mode = item.subtitle_mode
|
||||
eff_format = item.output_format
|
||||
eff_newlines = getattr(item, "replace_single_newlines", True)
|
||||
eff_silent = getattr(item, "use_silent_gaps", False)
|
||||
eff_method = getattr(item, "subtitle_speed_method", "tts")
|
||||
|
||||
# Retrieve File-Specific Data (Never Overridden)
|
||||
eff_chars = item.total_char_count
|
||||
eff_input = item.file_name
|
||||
eff_output = getattr(item, "output_path", "Unknown")
|
||||
eff_save_sep = getattr(item, "save_chapters_separately", None)
|
||||
eff_merge = getattr(item, "merge_chapters_at_end", None)
|
||||
|
||||
# --- Construct Display Block ---
|
||||
summary_html += (
|
||||
f"<span style='color:{COLORS['GREEN']}; font-weight:bold;'>{idx}) {os.path.basename(item.file_name)}</span><br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Language:</span> {item.lang_code}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Voice:</span> {item.voice}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Speed:</span> {item.speed}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Characters:</span> {item.total_char_count}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Input:</span> {item.file_name}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Output:</span> {output}</span>"
|
||||
f"<br><br>"
|
||||
f"<span style='color:{COLORS['GREEN']}; font-weight:bold;'>{idx}) {os.path.basename(eff_input)}</span><br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Language:</span> {eff_lang}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Voice:</span> {eff_voice}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Speed:</span> {eff_speed}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Characters:</span> {eff_chars}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Format:</span> {eff_format}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Subtitle Mode:</span> {eff_sub_mode}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Method:</span> {eff_method}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Silent Gaps:</span> {eff_silent}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Repl. Newlines:</span> {eff_newlines}<br>"
|
||||
)
|
||||
|
||||
# Book/Chapter specific options
|
||||
if eff_save_sep is not None:
|
||||
summary_html += f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Split Chapters:</span> {eff_save_sep}<br>"
|
||||
if eff_save_sep and eff_merge is not None:
|
||||
summary_html += f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Merge End:</span> {eff_merge}<br>"
|
||||
|
||||
summary_html += (
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Input:</span> {eff_input}<br>"
|
||||
f"<span style='color:{COLORS['LIGHT_DISABLED']};'>Output:</span> {eff_output}<br><br>"
|
||||
)
|
||||
|
||||
summary_html += "</body></html>"
|
||||
|
||||
dialog = QDialog(self)
|
||||
dialog.setWindowTitle("Queue Summary")
|
||||
dialog.resize(550, 650) # Make window resizable and larger
|
||||
# Allow resizing
|
||||
dialog.resize(550, 650)
|
||||
|
||||
layout = QVBoxLayout(dialog)
|
||||
text_edit = QTextEdit(dialog)
|
||||
@@ -2225,7 +2328,7 @@ class abogen(QWidget):
|
||||
|
||||
dialog.setLayout(layout)
|
||||
dialog.setMinimumSize(400, 300)
|
||||
dialog.setSizeGripEnabled(True) # Allow resizing
|
||||
dialog.setSizeGripEnabled(True)
|
||||
dialog.exec()
|
||||
|
||||
def on_conversion_finished(self, message, output_path):
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+25
-2
@@ -3,6 +3,8 @@ import sys
|
||||
import platform
|
||||
import atexit
|
||||
import signal
|
||||
from abogen.utils import get_resource_path, load_config, prevent_sleep_end
|
||||
|
||||
|
||||
# Fix PyTorch DLL loading issue ([WinError 1114]) on Windows before importing PyQt6
|
||||
if platform.system() == "Windows":
|
||||
@@ -21,6 +23,7 @@ if platform.system() == "Windows":
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
# Qt platform plugin detection (fixes #59)
|
||||
try:
|
||||
from PyQt6.QtCore import QLibraryInfo
|
||||
@@ -42,6 +45,28 @@ try:
|
||||
except ImportError:
|
||||
print("PyQt6 not installed.")
|
||||
|
||||
|
||||
# Pre-load "libxcb-cursor" on Linux (fixes #101)
|
||||
if platform.system() == "Linux":
|
||||
arch = platform.machine().lower()
|
||||
lib_filename = {"x86_64": "libxcb-cursor-amd64.so.0", "amd64": "libxcb-cursor-amd64.so.0", "aarch64": "libxcb-cursor-arm64.so.0", "arm64": "libxcb-cursor-arm64.so.0"}.get(arch)
|
||||
if lib_filename:
|
||||
import ctypes
|
||||
try:
|
||||
# Try to load the system libxcb-cursor.so.0 first
|
||||
ctypes.CDLL('libxcb-cursor.so.0', mode=ctypes.RTLD_GLOBAL)
|
||||
except OSError:
|
||||
# System lib not available, load the bundled version
|
||||
lib_path = get_resource_path('abogen.libs', lib_filename)
|
||||
if lib_path:
|
||||
try:
|
||||
ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
|
||||
except OSError:
|
||||
# If it fails (e.g. wrong glibc version on very old systems),
|
||||
# we simply ignore it and hope the system has the library.
|
||||
pass
|
||||
|
||||
|
||||
# Set application ID for Windows taskbar icon
|
||||
if platform.system() == "Windows":
|
||||
try:
|
||||
@@ -64,8 +89,6 @@ from PyQt6.QtCore import (
|
||||
# Add the directory to Python path
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__)))
|
||||
|
||||
from abogen.utils import get_resource_path, load_config, prevent_sleep_end
|
||||
|
||||
# Set Hugging Face Hub environment variables
|
||||
os.environ["HF_HUB_DISABLE_TELEMETRY"] = "1" # Disable Hugging Face telemetry
|
||||
os.environ["HF_HUB_ETAG_TIMEOUT"] = "10" # Metadata request timeout (seconds)
|
||||
|
||||
+74
-21
@@ -15,11 +15,27 @@ from PyQt6.QtWidgets import (
|
||||
QWidget,
|
||||
QSizePolicy,
|
||||
QAbstractItemView,
|
||||
QCheckBox,
|
||||
)
|
||||
from PyQt6.QtCore import QFileInfo, Qt
|
||||
from abogen.constants import COLORS
|
||||
from copy import deepcopy
|
||||
from PyQt6.QtGui import QFontMetrics
|
||||
from abogen.utils import load_config, save_config
|
||||
|
||||
# Define attributes that are safe to override with global settings
|
||||
OVERRIDE_FIELDS = [
|
||||
"lang_code",
|
||||
"speed",
|
||||
"voice",
|
||||
"save_option",
|
||||
"output_folder",
|
||||
"subtitle_mode",
|
||||
"output_format",
|
||||
"replace_single_newlines",
|
||||
"use_silent_gaps",
|
||||
"subtitle_speed_method",
|
||||
]
|
||||
|
||||
|
||||
class ElidedLabel(QLabel):
|
||||
@@ -149,6 +165,8 @@ class QueueManager(QDialog):
|
||||
queue
|
||||
) # Store a deep copy of the original queue
|
||||
self.parent = parent
|
||||
self.config = load_config() # Load config for persistence
|
||||
|
||||
layout = QVBoxLayout()
|
||||
layout.setContentsMargins(15, 15, 15, 15) # set main layout margins
|
||||
layout.setSpacing(12) # set spacing between widgets in main layout
|
||||
@@ -165,14 +183,27 @@ class QueueManager(QDialog):
|
||||
"<h2>How Queue Works?</h2>"
|
||||
"You can add text and subtitle files (.txt, .srt, .ass, .vtt) directly using the '<b>Add files</b>' button below. "
|
||||
"To add PDF, EPUB or markdown files, use the input box in the main window and click the <b>'Add to Queue'</b> button. "
|
||||
"Each file in the queue keeps the configuration settings active when it was added. "
|
||||
"Changing the main window configuration afterward <b>does not</b> affect files already in the queue. "
|
||||
"By default, each file in the queue keeps the configuration settings active when they were added. "
|
||||
"Enabling the <b>'Override item settings with current selection'</b> option below will force all items to use the configuration currently selected in the main window. "
|
||||
"You can view each file's configuration by hovering over them."
|
||||
)
|
||||
instructions.setAlignment(Qt.AlignmentFlag.AlignLeft)
|
||||
instructions.setWordWrap(True)
|
||||
instructions.setStyleSheet("margin-bottom: 8px;")
|
||||
layout.addWidget(instructions)
|
||||
|
||||
# Override Checkbox
|
||||
self.override_chk = QCheckBox("Override item settings with current selection")
|
||||
self.override_chk.setToolTip(
|
||||
"If checked, all items in the queue will be processed using the \n"
|
||||
"settings currently selected in the main window, ignoring their saved state."
|
||||
)
|
||||
# Load saved state (default to False)
|
||||
self.override_chk.setChecked(self.config.get("queue_override_settings", False))
|
||||
# Trigger process_queue to update tooltips immediately when toggled
|
||||
self.override_chk.stateChanged.connect(self.process_queue)
|
||||
self.override_chk.setStyleSheet("margin-bottom: 8px;")
|
||||
layout.addWidget(self.override_chk)
|
||||
|
||||
# Overlay label for empty queue
|
||||
self.empty_overlay = QLabel(
|
||||
"Drag and drop your text or subtitle files here or use the 'Add files' button.",
|
||||
@@ -245,8 +276,21 @@ class QueueManager(QDialog):
|
||||
return
|
||||
else:
|
||||
self.empty_overlay.hide()
|
||||
|
||||
# Get current global settings and checkbox state for overrides
|
||||
current_global_settings = self.get_current_attributes()
|
||||
is_override_active = self.override_chk.isChecked()
|
||||
|
||||
icon_provider = QFileIconProvider()
|
||||
for item in self.queue:
|
||||
# Dynamic Attribute Retrieval Helper
|
||||
def get_val(attr, default=""):
|
||||
# If override is ON and attr is overrideable, use global setting
|
||||
if is_override_active and attr in OVERRIDE_FIELDS:
|
||||
return current_global_settings.get(attr, default)
|
||||
# Otherwise return the item's saved attribute
|
||||
return getattr(item, attr, default)
|
||||
|
||||
# Determine display file path (prefer save_base_path for original file)
|
||||
display_file_path = getattr(item, "save_base_path", None) or item.file_name
|
||||
processing_file_path = item.file_name
|
||||
@@ -271,8 +315,14 @@ class QueueManager(QDialog):
|
||||
# Get icon for the display file
|
||||
icon = icon_provider.icon(QFileInfo(display_file_path))
|
||||
list_item = QListWidgetItem()
|
||||
# Set tooltip with detailed info
|
||||
output_folder = getattr(item, "output_folder", "")
|
||||
|
||||
# Tooltip Generation
|
||||
tooltip = ""
|
||||
# If override is active, add the warning header on its own line
|
||||
if is_override_active:
|
||||
tooltip += "<b style='color: #ff9900;'>(Global Override Active)</b><br>"
|
||||
|
||||
output_folder = get_val("output_folder")
|
||||
# For plain .txt inputs we don't need to show a separate processing file
|
||||
show_processing = True
|
||||
try:
|
||||
@@ -283,30 +333,31 @@ class QueueManager(QDialog):
|
||||
except Exception:
|
||||
show_processing = True
|
||||
|
||||
tooltip = f"<b>Input File:</b> {display_file_path}<br>"
|
||||
tooltip += f"<b>Input File:</b> {display_file_path}<br>"
|
||||
if (
|
||||
show_processing
|
||||
and processing_file_path
|
||||
and processing_file_path != display_file_path
|
||||
):
|
||||
tooltip += f"<b>Processing File:</b> {processing_file_path}<br>"
|
||||
|
||||
tooltip += (
|
||||
f"<b>Language:</b> {getattr(item, 'lang_code', '')}<br>"
|
||||
f"<b>Speed:</b> {getattr(item, 'speed', '')}<br>"
|
||||
f"<b>Voice:</b> {getattr(item, 'voice', '')}<br>"
|
||||
f"<b>Save Option:</b> {getattr(item, 'save_option', '')}<br>"
|
||||
f"<b>Language:</b> {get_val('lang_code')}<br>"
|
||||
f"<b>Speed:</b> {get_val('speed')}<br>"
|
||||
f"<b>Voice:</b> {get_val('voice')}<br>"
|
||||
f"<b>Save Option:</b> {get_val('save_option')}<br>"
|
||||
)
|
||||
if output_folder not in (None, "", "None"):
|
||||
tooltip += f"<b>Output Folder:</b> {output_folder}<br>"
|
||||
tooltip += (
|
||||
f"<b>Subtitle Mode:</b> {getattr(item, 'subtitle_mode', '')}<br>"
|
||||
f"<b>Output Format:</b> {getattr(item, 'output_format', '')}<br>"
|
||||
f"<b>Subtitle Mode:</b> {get_val('subtitle_mode')}<br>"
|
||||
f"<b>Output Format:</b> {get_val('output_format')}<br>"
|
||||
f"<b>Characters:</b> {getattr(item, 'total_char_count', '')}<br>"
|
||||
f"<b>Replace Single Newlines:</b> {getattr(item, 'replace_single_newlines', False)}<br>"
|
||||
f"<b>Use Silent Gaps:</b> {getattr(item, 'use_silent_gaps', False)}<br>"
|
||||
f"<b>Speed Method:</b> {getattr(item, 'subtitle_speed_method', 'tts')}"
|
||||
f"<b>Replace Single Newlines:</b> {get_val('replace_single_newlines', True)}<br>"
|
||||
f"<b>Use Silent Gaps:</b> {get_val('use_silent_gaps', False)}<br>"
|
||||
f"<b>Speed Method:</b> {get_val('subtitle_speed_method', 'tts')}"
|
||||
)
|
||||
# Add book handler options if present
|
||||
# Add book handler options if present (Preserve logic: specific to file structure)
|
||||
save_chapters_separately = getattr(item, "save_chapters_separately", None)
|
||||
merge_chapters_at_end = getattr(item, "merge_chapters_at_end", None)
|
||||
if save_chapters_separately is not None:
|
||||
@@ -415,7 +466,7 @@ class QueueManager(QDialog):
|
||||
attrs["total_char_count"] = getattr(parent, "char_count", "")
|
||||
# replace_single_newlines
|
||||
attrs["replace_single_newlines"] = getattr(
|
||||
parent, "replace_single_newlines", False
|
||||
parent, "replace_single_newlines", True
|
||||
)
|
||||
# use_silent_gaps
|
||||
attrs["use_silent_gaps"] = getattr(parent, "use_silent_gaps", False)
|
||||
@@ -501,8 +552,8 @@ class QueueManager(QDialog):
|
||||
== getattr(item, "output_format", None)
|
||||
and getattr(queued_item, "total_char_count", None)
|
||||
== getattr(item, "total_char_count", None)
|
||||
and getattr(queued_item, "replace_single_newlines", False)
|
||||
== getattr(item, "replace_single_newlines", False)
|
||||
and getattr(queued_item, "replace_single_newlines", True)
|
||||
== getattr(item, "replace_single_newlines", True)
|
||||
and getattr(queued_item, "use_silent_gaps", False)
|
||||
== getattr(item, "use_silent_gaps", False)
|
||||
and getattr(queued_item, "subtitle_speed_method", "tts")
|
||||
@@ -531,7 +582,6 @@ class QueueManager(QDialog):
|
||||
|
||||
def add_more_files(self):
|
||||
from PyQt6.QtWidgets import QFileDialog
|
||||
from abogen.utils import calculate_text_length # import the function
|
||||
|
||||
# Allow .txt, .srt, .ass, and .vtt files
|
||||
files, _ = QFileDialog.getOpenFileNames(
|
||||
@@ -774,7 +824,10 @@ class QueueManager(QDialog):
|
||||
menu.exec(global_pos)
|
||||
|
||||
def accept(self):
|
||||
# Accept: keep changes
|
||||
# Save the override state to config so it persists globally
|
||||
self.config["queue_override_settings"] = self.override_chk.isChecked()
|
||||
save_config(self.config)
|
||||
|
||||
super().accept()
|
||||
|
||||
def reject(self):
|
||||
|
||||
@@ -13,7 +13,7 @@ class QueuedItem:
|
||||
subtitle_mode: str
|
||||
output_format: str
|
||||
total_char_count: int
|
||||
replace_single_newlines: bool = False
|
||||
replace_single_newlines: bool = True
|
||||
use_silent_gaps: bool = False
|
||||
subtitle_speed_method: str = "tts"
|
||||
save_base_path: str = None
|
||||
|
||||
+12
-6
@@ -77,13 +77,18 @@ def get_spacy_model(lang_code, log_callback=None):
|
||||
# Try to load the model
|
||||
try:
|
||||
log(f"\nLoading spaCy model '{model_name}'...")
|
||||
# sentence segmentation involving parentheses, quotes, and complex structure.
|
||||
# We only disable heavier components we don't need like NER.
|
||||
nlp = spacy.load(
|
||||
model_name,
|
||||
disable=["ner", "parser", "tagger", "lemmatizer", "attribute_ruler"],
|
||||
disable=["ner", "tagger", "lemmatizer", "attribute_ruler"],
|
||||
)
|
||||
# Enable sentence segmentation only
|
||||
if "sentencizer" not in nlp.pipe_names:
|
||||
|
||||
# Ensure a sentence segmentation strategy is in place
|
||||
# The parser provides sents, but if it's missing (unlikely for core models), fallback to sentencizer
|
||||
if "parser" not in nlp.pipe_names and "sentencizer" not in nlp.pipe_names:
|
||||
nlp.add_pipe("sentencizer")
|
||||
|
||||
_nlp_cache[lang_code] = nlp
|
||||
return nlp
|
||||
except OSError:
|
||||
@@ -93,13 +98,14 @@ def get_spacy_model(lang_code, log_callback=None):
|
||||
from spacy.cli import download
|
||||
|
||||
download(model_name)
|
||||
# Retry loading
|
||||
# Retry loading with the same fix
|
||||
nlp = spacy.load(
|
||||
model_name,
|
||||
disable=["ner", "parser", "tagger", "lemmatizer", "attribute_ruler"],
|
||||
disable=["ner", "tagger", "lemmatizer", "attribute_ruler"],
|
||||
)
|
||||
if "sentencizer" not in nlp.pipe_names:
|
||||
if "parser" not in nlp.pipe_names and "sentencizer" not in nlp.pipe_names:
|
||||
nlp.add_pipe("sentencizer")
|
||||
|
||||
_nlp_cache[lang_code] = nlp
|
||||
log(f"spaCy model '{model_name}' downloaded and loaded")
|
||||
return nlp
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ _sleep_procs = {"Darwin": None, "Linux": None} # Store sleep prevention process
|
||||
def clean_text(text, *args, **kwargs):
|
||||
# Load replace_single_newlines from config
|
||||
cfg = load_config()
|
||||
replace_single_newlines = cfg.get("replace_single_newlines", False)
|
||||
replace_single_newlines = cfg.get("replace_single_newlines", True)
|
||||
# Collapse all whitespace (excluding newlines) into single spaces per line and trim edges
|
||||
# Use pre-compiled pattern for better performance
|
||||
lines = [_WHITESPACE_PATTERN.sub(" ", line).strip() for line in text.splitlines()]
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Build PyPI package (wheel and sdist) to `dist` folder for abogen."""
|
||||
|
||||
import subprocess
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
|
||||
def main():
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
output_dir = os.path.join(script_dir, "dist")
|
||||
|
||||
print("🔧 abogen PyPI Package Builder")
|
||||
print("=" * 40)
|
||||
print(f"📁 Script directory: {script_dir}")
|
||||
print(f"📦 Output directory: {output_dir}")
|
||||
|
||||
# Try to print package version if present
|
||||
version = None
|
||||
version_file = os.path.join(script_dir, "abogen", "VERSION")
|
||||
if os.path.isfile(version_file):
|
||||
try:
|
||||
with open(version_file, "r", encoding="utf-8") as vf:
|
||||
version = vf.read().strip()
|
||||
except Exception:
|
||||
version = None
|
||||
if version:
|
||||
print(f"🔖 Package version: {version}")
|
||||
|
||||
# Check if build module is installed, install if not
|
||||
# Temporarily remove script_dir from sys.path to avoid importing local build.py
|
||||
import sys
|
||||
original_path = sys.path[:]
|
||||
try:
|
||||
sys.path = [p for p in sys.path if os.path.abspath(p) != script_dir]
|
||||
import build
|
||||
except ImportError:
|
||||
print("📦 Installing build module...")
|
||||
subprocess.run([sys.executable, "-m", "pip", "install", "build"], check=True)
|
||||
finally:
|
||||
sys.path = original_path
|
||||
|
||||
# Create output directory
|
||||
print(f"📂 Preparing output directory: {output_dir}")
|
||||
if os.path.exists(output_dir):
|
||||
shutil.rmtree(output_dir)
|
||||
os.makedirs(output_dir, exist_ok=True)
|
||||
|
||||
print("🏗️ Building PyPI package...")
|
||||
print(" Using temporary directory to avoid module conflicts...")
|
||||
|
||||
# Run from temp directory to avoid local build.py shadowing the build module
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
print(f" Temp directory: {tmpdir}")
|
||||
print(" Running: python -m build -o <output_dir> <source_dir>")
|
||||
|
||||
result = subprocess.run(
|
||||
[sys.executable, "-m", "build", "-o", output_dir, script_dir],
|
||||
check=False,
|
||||
cwd=tmpdir,
|
||||
)
|
||||
|
||||
print("\n" + "=" * 40)
|
||||
if result.returncode == 0:
|
||||
print("✅ Build successful!")
|
||||
print(f"📦 Files created in {output_dir}:")
|
||||
|
||||
files = os.listdir(output_dir)
|
||||
if files:
|
||||
for f in files:
|
||||
file_path = os.path.join(output_dir, f)
|
||||
size = os.path.getsize(file_path)
|
||||
print(f" 📄 {f} ({size:,} bytes)")
|
||||
else:
|
||||
print(" (No files found)")
|
||||
|
||||
print("\n🚀 Ready for upload with:\n")
|
||||
print(" - To test on Test PyPI:")
|
||||
print(f" python -m twine upload --repository testpypi {output_dir}/*")
|
||||
print("\n - To upload to PyPI (when ready):")
|
||||
print(f" python -m twine upload {output_dir}/*")
|
||||
else:
|
||||
print("❌ Build failed!")
|
||||
print(f" Exit code: {result.returncode}")
|
||||
sys.exit(result.returncode)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 103 KiB |
@@ -13,6 +13,7 @@ license = "MIT"
|
||||
requires-python = ">=3.10, <3.13"
|
||||
keywords = ["audiobook", "epub", "pdf", "text-to-speech", "subtitle", "tts", "kokoro", "accessibility", "book-converter", "voice-synthesis", "multilingual", "chapter-management", "subtitles", "content-creation", "media-generation"]
|
||||
dependencies = [
|
||||
"pip",
|
||||
"PyQt6>=6.10.0",
|
||||
"kokoro>=0.9.4",
|
||||
"misaki[zh]>=0.9.4",
|
||||
@@ -70,3 +71,77 @@ packages = ["abogen"]
|
||||
[tool.hatch.version]
|
||||
path = "abogen/VERSION"
|
||||
pattern = "^(?P<version>.+)$"
|
||||
|
||||
# --- OPTIONAL DEPENDENCIES ---
|
||||
|
||||
[project.optional-dependencies]
|
||||
# NVIDIA GPU (Windows) (CUDA 12.6) # uv tool install abogen[cuda126]
|
||||
cuda126 = ["torch"]
|
||||
# NVIDIA GPU (Windows) (CUDA 12.8) # uv tool install abogen[cuda]
|
||||
cuda = ["torch"]
|
||||
# NVIDIA GPU (Windows) (CUDA 13.0) # uv tool install abogen[cuda130]
|
||||
cuda130 = ["torch"]
|
||||
# AMD GPU (Linux) (ROCm 6.4) # uv tool install abogen[rocm]
|
||||
rocm = ["torch", "pytorch-triton-rocm"]
|
||||
|
||||
# --- KOKORO CONFIGURATION (for macOS) ---
|
||||
|
||||
[tool.uv.sources]
|
||||
kokoro = [
|
||||
{ git = "https://github.com/hexgrad/kokoro.git", marker = "sys_platform == 'darwin'" },
|
||||
{ index = "pypi", marker = "sys_platform != 'darwin'" }
|
||||
]
|
||||
|
||||
# --- TORCH CONFIGURATION ---
|
||||
|
||||
torch = [
|
||||
# ROCm 6.4 Nightly (AMD)
|
||||
{ index = "pytorch-rocm-64-nightly", marker = "extra == 'rocm'" },
|
||||
|
||||
# CUDA 13.0 (NVIDIA)
|
||||
{ index = "pytorch-cuda-130", marker = "extra == 'cuda130' and extra != 'rocm'" },
|
||||
|
||||
# CUDA 12.6 (NVIDIA)
|
||||
{ index = "pytorch-cuda-126", marker = "extra == 'cuda126' and extra != 'rocm' and extra != 'cuda130'" },
|
||||
|
||||
# CUDA 12.8 (NVIDIA)
|
||||
{ index = "pytorch-cuda-128", marker = "extra == 'cuda' and extra != 'rocm' and extra != 'cuda130' and extra != 'cuda126'" }
|
||||
]
|
||||
|
||||
# --- TRITON CONFIGURATION ---
|
||||
|
||||
pytorch-triton-rocm = [
|
||||
{ index = "pytorch-rocm-64-nightly", marker = "extra == 'rocm'" }
|
||||
]
|
||||
|
||||
# --- INDEX DEFINITIONS ---
|
||||
|
||||
# PyPI Index
|
||||
[[tool.uv.index]]
|
||||
name = "pypi"
|
||||
url = "https://pypi.org/simple"
|
||||
default = true
|
||||
|
||||
# CUDA 12.6 Index
|
||||
[[tool.uv.index]]
|
||||
name = "pytorch-cuda-126"
|
||||
url = "https://download.pytorch.org/whl/cu126"
|
||||
explicit = true
|
||||
|
||||
# CUDA 12.8 Index
|
||||
[[tool.uv.index]]
|
||||
name = "pytorch-cuda-128"
|
||||
url = "https://download.pytorch.org/whl/cu128"
|
||||
explicit = true
|
||||
|
||||
# CUDA 13.0 Index
|
||||
[[tool.uv.index]]
|
||||
name = "pytorch-cuda-130"
|
||||
url = "https://download.pytorch.org/whl/cu130"
|
||||
explicit = true
|
||||
|
||||
# ROCm 6.4 Nightly Index
|
||||
[[tool.uv.index]]
|
||||
name = "pytorch-rocm-64-nightly"
|
||||
url = "https://download.pytorch.org/whl/nightly/rocm6.4"
|
||||
explicit = true
|
||||
|
||||
Reference in New Issue
Block a user