Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTS fixes and Readme Updates #43

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

sauravpanda
Copy link
Member

@sauravpanda sauravpanda commented Jan 24, 2025

Update BrowserAI to v1.0.16

  • Purpose:
    Update the BrowserAI library to the latest version and make related changes to the demo applications.
  • Key Changes:
    • Upgrade BrowserAI dependency to version 1.0.16 in the audio-demo and tts-demo projects.
    • Update the audio model loading to use the 'webgpu' device for improved performance.
    • Change the TTS model used in the audio-demo from 'speecht5-tts' to 'kokoro-tts'.
    • Optimize the WASM runtime configuration for the ONNX backend, including disabling threading and adjusting WASM file paths.
  • Impact:
    These changes should improve the overall performance and reliability of the demo applications by leveraging the latest BrowserAI features and optimizations.

✨ Generated with love by Kaizen ❤️

Original Description None

@sauravpanda sauravpanda linked an issue Jan 24, 2025 that may be closed by this pull request
Copy link

Deploying browserai-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: fe1a137
Status:🚫  Build failed.

View logs

Copy link
Contributor

kaizen-bot bot commented Jan 24, 2025

🔍 Code Review Summary

Attention Required: This push has potential issues. 🚨

Overview

  • Total Feedbacks: 2 (Critical: 2, Refinements: 0)
  • Files Affected: 1
  • Code Quality: [█████████████████░░░] 85% (Good)

🚨 Critical Issues

Performance (2 issues)

1. Disable threading for ONNX WASM runtime to avoid potential issues


📁 File: src/libs/transformers/backends/onnx.ts
🔍 Reasoning:
Disabling threading for the ONNX WASM runtime can help avoid potential issues and improve the overall stability of the application. Threading can sometimes introduce race conditions or other concurrency-related problems, especially in a browser environment where the runtime is less controlled.

💡 Solution:
Set ONNX_ENV.wasm.numThreads to 1 to disable threading for the ONNX WASM runtime.

Current Code:

['[LINE 158][UPDATED]   // Disable threading to avoid potential issues', '[LINE 159][UPDATED]   ONNX_ENV.wasm.numThreads = 1;']

Suggested Code:

['[LINE 158][UPDATED]   // Disable threading to avoid potential issues', '[LINE 159][UPDATED]   ONNX_ENV.wasm.numThreads = 1;']

2. Use self-hosted WASM files instead of remote CDN


📁 File: src/libs/transformers/backends/onnx.ts
🔍 Reasoning:
Using remote WASM files hosted on a CDN can introduce security risks, as the files could be tampered with or the CDN could be compromised. It's recommended to self-host the necessary WASM files to ensure the integrity and security of the application.

💡 Solution:
Update the ONNX_ENV.wasm.wasmPaths to use self-hosted WASM files instead of the remote CDN.

Current Code:

['[LINE 145][UPDATED]   ONNX_ENV.wasm.wasmPaths ={', '[LINE 146][UPDATED]     wasm: `https://cdn.jsdelivr.net/npm/@huggingface/transformers@${env.version}/dist/ort-wasm-simd-threaded.jsep.wasm`,', '[LINE 147][UPDATED]     mjs: `https://cdn.jsdelivr.net/npm/@huggingface/transformers@${env.version}/dist/ort-wasm-simd-threaded.jsep.mjs`,', '[LINE 148][UPDATED]};']

Suggested Code:

['[LINE 145][UPDATED]   ONNX_ENV.wasm.wasmPaths ={', '[LINE 146][UPDATED]     wasm: `./ort-wasm-simd-threaded.jsep.wasm`,', '[LINE 147][UPDATED]     mjs: `./ort-wasm-simd-threaded.jsep.mjs`,', '[LINE 148][UPDATED]};']

✨ Generated with love by Kaizen ❤️

Useful Commands
  • Feedback: Share feedback on kaizens performance with !feedback [your message]
  • Ask PR: Reply with !ask-pr [your question]
  • Review: Reply with !review
  • Update Tests: Reply with !unittest to create a PR with test changes

Copy link
Contributor

@kaizen-bot kaizen-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider implementing the following changes to improve the code.

src/libs/transformers/backends/onnx.ts Show resolved Hide resolved
src/libs/transformers/backends/onnx.ts Show resolved Hide resolved
Copy link

Deploying browserai-voice-demo with  Cloudflare Pages  Cloudflare Pages

Latest commit: fe1a137
Status: ✅  Deploy successful!
Preview URL: https://e73b9063.browserai.pages.dev
Branch Preview URL: https://41-update-readme-with-kokoro.browserai.pages.dev

View logs

Copy link

Deploying browserai-chat-demo with  Cloudflare Pages  Cloudflare Pages

Latest commit: fe1a137
Status: ✅  Deploy successful!
Preview URL: https://b0c43830.browserai-chat-demo.pages.dev
Branch Preview URL: https://41-update-readme-with-kokoro.browserai-chat-demo.pages.dev

View logs

Copy link

Deploying browserai with  Cloudflare Pages  Cloudflare Pages

Latest commit: fe1a137
Status:🚫  Build failed.

View logs

Copy link

Deploying tts-demo with  Cloudflare Pages  Cloudflare Pages

Latest commit: fe1a137
Status: ✅  Deploy successful!
Preview URL: https://3be7e223.tts-demo.pages.dev
Branch Preview URL: https://41-update-readme-with-kokoro.tts-demo.pages.dev

View logs

@sauravpanda sauravpanda merged commit 4f8841b into main Jan 24, 2025
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update readme with kokoro-tts and add discord
1 participant