Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
Target branch: Please verify that the pull request targets the dev branch.
Description: Convert TTS requests to async using aiohttp/aiofiles to prevent message blocking during text-to-speech generation.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Testing: Have you written and run sufficient tests for validating the changes?
Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
Prefix: To cleary categorize this pull request, prefix the pull request title, using one of the following:
BREAKING CHANGE: Significant changes that may affect compatibility
build: Changes that affect the build system or external dependencies
ci: Changes to our continuous integration processes or workflows
chore: Refactor, cleanup, or other non-functional code changes
docs: Documentation update or addition
feat: Introduces a new feature or enhancement to the codebase
fix: Bug fix or error correction
i18n: Internationalization or localization changes
perf: Performance improvement
refactor: Code restructuring for better maintainability, readability, or scalability
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
test: Adding missing tests or correcting existing tests
WIP: Work in progress, a temporary label for incomplete or ongoing work
Changelog Entry
Description
Convert TTS requests to async using aiohttp/aiofiles to prevent message blocking during text-to-speech generation. This fixes the issue where other messages were frozen while waiting for TTS API responses.
Changed
Sending TTS requests in backend/open_webui/apps/audio/main.py
Fixed
Other messages freezing and waiting for TTS generation completion.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/7286
**Author:** [@houcheng](https://github.com/houcheng)
**Created:** 11/23/2024
**Status:** ✅ Merged
**Merged:** 11/24/2024
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `tts-aiofiles`
---
### 📝 Commits (2)
- [`db929b5`](https://github.com/open-webui/open-webui/commit/db929b5d5ec1694a80ae707a74a52a6dac9f7451) Merge pull request #7262 from open-webui/dev
- [`a83f89d`](https://github.com/open-webui/open-webui/commit/a83f89d4305556427f922add4dc858632dcf4d99) fix: prevent TTS blocking using aiohttp and aiofiles
### 📊 Changes
**2 files changed** (+49 additions, -58 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/apps/audio/main.py` (+48 -58)
📝 `backend/requirements.txt` (+1 -0)
</details>
### 📄 Description
# Pull Request Checklist
### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request.
**Before submitting, make sure you've checked the following:**
- [x] **Target branch:** Please verify that the pull request targets the `dev` branch.
- [x] **Description:** Convert TTS requests to async using aiohttp/aiofiles to prevent message blocking during text-to-speech generation.
- [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources?
- [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
- [ ] **Testing:** Have you written and run sufficient tests for validating the changes?
- [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
- [x] **Prefix:** To cleary categorize this pull request, prefix the pull request title, using one of the following:
- **BREAKING CHANGE**: Significant changes that may affect compatibility
- **build**: Changes that affect the build system or external dependencies
- **ci**: Changes to our continuous integration processes or workflows
- **chore**: Refactor, cleanup, or other non-functional code changes
- **docs**: Documentation update or addition
- **feat**: Introduces a new feature or enhancement to the codebase
- **fix**: Bug fix or error correction
- **i18n**: Internationalization or localization changes
- **perf**: Performance improvement
- **refactor**: Code restructuring for better maintainability, readability, or scalability
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
- **test**: Adding missing tests or correcting existing tests
- **WIP**: Work in progress, a temporary label for incomplete or ongoing work
# Changelog Entry
### Description
- Convert TTS requests to async using aiohttp/aiofiles to prevent message blocking during text-to-speech generation. This fixes the issue where other messages were frozen while waiting for TTS API responses.
### Changed
- Sending TTS requests in `backend/open_webui/apps/audio/main.py`
### Fixed
- Other messages freezing and waiting for TTS generation completion.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/7286
Author: @houcheng
Created: 11/23/2024
Status: ✅ Merged
Merged: 11/24/2024
Merged by: @tjbck
Base:
dev← Head:tts-aiofiles📝 Commits (2)
db929b5Merge pull request #7262 from open-webui/deva83f89dfix: prevent TTS blocking using aiohttp and aiofiles📊 Changes
2 files changed (+49 additions, -58 deletions)
View changed files
📝
backend/open_webui/apps/audio/main.py(+48 -58)📝
backend/requirements.txt(+1 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Changed
backend/open_webui/apps/audio/main.pyFixed
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.