Skip to content

refactor(stage-tamagotchi,crates): no more cuda required and candle removed#323

Merged
nekomeowww merged 2 commits intomainfrom
dev/no-candle-and-cuda
Jul 25, 2025
Merged

refactor(stage-tamagotchi,crates): no more cuda required and candle removed#323
nekomeowww merged 2 commits intomainfrom
dev/no-candle-and-cuda

Conversation

@nekomeowww
Copy link
Copy Markdown
Member

Description

Close #310, related to #319

Linked Issues

Additional context

@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 25, 2025

Deploy Preview for airi-docs ready!

Name Link
🔨 Latest commit a3c6771
🔍 Latest deploy log https://app.netlify.com/projects/airi-docs/deploys/68832dc103e9d50009b6912c
😎 Deploy Preview https://deploy-preview-323--airi-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 25, 2025

Deploy Preview for airi-vtuber ready!

Name Link
🔨 Latest commit a3c6771
🔍 Latest deploy log https://app.netlify.com/projects/airi-vtuber/deploys/68832dc115dd79000896f44e
😎 Deploy Preview https://deploy-preview-323--airi-vtuber.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @nekomeowww, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the audio transcription capabilities by replacing the candle machine learning framework with ONNX Runtime. This strategic shift aims to enhance the application's performance, reduce specific hardware dependencies, and streamline the underlying machine learning inference pipeline. The changes span across the Rust backend, build configurations, and the frontend interface to ensure a seamless transition to the new technology.

Highlights

  • Technology Migration: The core audio transcription functionality has been migrated from the candle machine learning framework to ONNX Runtime (ORT). This change aims to improve performance and broaden compatibility with various hardware accelerators.
  • CUDA Dependency Removal: The direct dependency on CUDA for GPU acceleration within the stage-tamagotchi application has been removed. The new ONNX Runtime integration now leverages its own execution providers, including CoreML for macOS, DirectML and CUDA for Windows, and CUDA for Linux, offering more flexible GPU support.
  • Plugin Renaming and Restructuring: The audio transcription plugin has been renamed from tauri-plugin-ipc-audio-transcription-candle to tauri-plugin-ipc-audio-transcription-ort to accurately reflect the underlying technology. This involved creating a new Rust crate and updating all references across the application.
  • Build System and Frontend Updates: Extensive updates were made to Cargo.toml and Cargo.lock files to reflect the new ORT dependencies and remove all candle-related packages. The frontend application (apps/stage-tamagotchi/src/) was also updated to invoke the new ORT-based plugin and adapt to changes in the transcription result format (e.g., no longer returning language as a separate value).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the audio transcription plugin to use ONNX Runtime (ort) instead of candle, removing the CUDA dependency and providing a more flexible backend. I have identified a few critical issues that need to be addressed regarding event handling, audio processing, and API mismatch. I have also included some suggestions to improve maintainability by renaming components that still carry the old candle naming. Addressing these points will ensure the stability and correctness of this new implementation.

Comment thread apps/stage-tamagotchi/src/composables/tauri.ts
Comment thread apps/stage-tamagotchi/src/pages/index.vue
Comment on lines +93 to +99
let transcription = processor
.transcribe(chunk.as_slice(), &config)
.map_err(|e| e.to_string())?;

info!("Transcription completed: {}", transcription);

Ok((transcription, language))
Ok(transcription)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

The frontend expects the ipc_audio_transcription command to return a single-element array (a tuple in Rust), but the current implementation returns a single String. This will cause a deserialization error or unexpected behavior on the frontend when it tries to destructure the result.

The returned value should be wrapped in a tuple to match the frontend's expectation.

Suggested change
let transcription = processor
.transcribe(chunk.as_slice(), &config)
.map_err(|e| e.to_string())?;
info!("Transcription completed: {}", transcription);
Ok((transcription, language))
Ok(transcription)
let transcription = processor
.transcribe(chunk.as_slice(), &config)
.map_err(|e| e.to_string())?;
info!("Transcription completed: {}", transcription);
Ok((transcription,))

Comment thread apps/stage-tamagotchi/src/pages/index.vue Outdated
Comment thread apps/stage-tamagotchi/src/tauri/invoke.ts Outdated
Comment thread crates/tauri-plugin-ipc-audio-transcription-ort/src/lib.rs Outdated
@typed-sigterm
Copy link
Copy Markdown
Collaborator

I'll build and test it later 👀

@nekomeowww
Copy link
Copy Markdown
Member Author

Let me merge it so we have have a test with our CI/CD.

@nekomeowww nekomeowww merged commit 4b0577d into main Jul 25, 2025
14 checks passed
@nekomeowww nekomeowww deleted the dev/no-candle-and-cuda branch July 25, 2025 07:12
@nekomeowww
Copy link
Copy Markdown
Member Author

I'll build and test it later 👀

Build succeeded, @typed-sigterm try this:

https://github.com/moeru-ai/airi/actions/runs/16516148177

For @Weathercold, I got another PR about Nix, hold on.

Disqort pushed a commit to Disqort/airi that referenced this pull request Aug 29, 2025
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.

Cannot launch stage-tamagotchi v0.7.0-alpha.1

2 participants