Explorar o código

refactor(project): rename MelBandRoformer to BSRoformer

Rename project, library, and executable from MelBandRoformer to BSRoformer
across all source files, build configuration, documentation, and CI workflows.
This includes updating CMake targets, include directories, class names,
CLI executable names, and release artifact naming. The architecture string
normalization also updated to map "mel_band" to "bs_roformer".
沉默の金 hai 4 meses
pai
achega
6924c9842d

+ 12 - 12
.github/workflows/build.yml

@@ -276,8 +276,8 @@ jobs:
           echo "=== CLI Test Suite ==="
           
           # Dynamically find CLI executable
-          CLI_NAME="mel_band_roformer-cli"
-          if [[ "$RUNNER_OS" == "Windows" ]]; then CLI_NAME="mel_band_roformer-cli.exe"; fi
+          CLI_NAME="bs_roformer-cli"
+          if [[ "$RUNNER_OS" == "Windows" ]]; then CLI_NAME="bs_roformer-cli.exe"; fi
           
           echo "Searching for $CLI_NAME..."
           CLI_PATH=$(find build -name "$CLI_NAME" | head -n 1)
@@ -370,7 +370,7 @@ jobs:
             build/*.dll
             build/*.so
             build/*.dylib
-            build/mel_band_roformer-cli*
+            build/bs_roformer-cli*
             build/Release/
           retention-days: 7
       
@@ -383,10 +383,10 @@ jobs:
           mkdir -p release/mel-band-roformer
           
           # Find and copy CLI executable
-          CLI_PATH=$(find build -name "mel_band_roformer-cli" -type f | head -n 1)
+          CLI_PATH=$(find build -name "bs_roformer-cli" -type f | head -n 1)
           if [[ -n "$CLI_PATH" ]]; then
             cp "$CLI_PATH" release/mel-band-roformer/
-            chmod +x release/mel-band-roformer/mel_band_roformer-cli
+            chmod +x release/mel-band-roformer/bs_roformer-cli
           fi
           
           # Copy shared libraries if exist (only real files, not symlinks)
@@ -406,7 +406,7 @@ jobs:
           New-Item -ItemType Directory -Force -Path "release\mel-band-roformer"
           
           # Find and copy CLI executable
-          $CliPath = Get-ChildItem -Path build -Filter "mel_band_roformer-cli.exe" -Recurse -File | Select-Object -First 1
+          $CliPath = Get-ChildItem -Path build -Filter "bs_roformer-cli.exe" -Recurse -File | Select-Object -First 1
           if ($CliPath) {
             Copy-Item $CliPath.FullName "release\mel-band-roformer\"
           }
@@ -423,7 +423,7 @@ jobs:
       - name: Upload Release Artifact
         uses: actions/upload-artifact@v4
         with:
-          name: MelBandRoformer-${{ matrix.name }}
+          name: BSRoformer-${{ matrix.name }}
           path: release/mel-band-roformer/
           retention-days: 30
 
@@ -502,10 +502,10 @@ jobs:
           mkdir -p release/mel-band-roformer
           
           # Find and copy CLI executable
-          CLI_PATH=$(find build -name "mel_band_roformer-cli" -type f | head -n 1)
+          CLI_PATH=$(find build -name "bs_roformer-cli" -type f | head -n 1)
           if [[ -n "$CLI_PATH" ]]; then
             cp "$CLI_PATH" release/mel-band-roformer/
-            chmod +x release/mel-band-roformer/mel_band_roformer-cli
+            chmod +x release/mel-band-roformer/bs_roformer-cli
           fi
           
           # Copy shared libraries
@@ -520,7 +520,7 @@ jobs:
       - name: Upload Release Artifact
         uses: actions/upload-artifact@v4
         with:
-          name: MelBandRoformer-linux-cuda-${{ matrix.cuda_version }}
+          name: BSRoformer-linux-cuda-${{ matrix.cuda_version }}
           path: release/mel-band-roformer/
           retention-days: 30
 
@@ -622,7 +622,7 @@ jobs:
           New-Item -ItemType Directory -Force -Path "release\mel-band-roformer"
           
           # Find and copy CLI executable
-          $CliPath = Get-ChildItem -Path build -Filter "mel_band_roformer-cli.exe" -Recurse -File | Select-Object -First 1
+          $CliPath = Get-ChildItem -Path build -Filter "bs_roformer-cli.exe" -Recurse -File | Select-Object -First 1
           if ($CliPath) {
             Copy-Item $CliPath.FullName "release\mel-band-roformer\"
           }
@@ -639,6 +639,6 @@ jobs:
       - name: Upload Release Artifact
         uses: actions/upload-artifact@v4
         with:
-          name: MelBandRoformer-windows-cuda-${{ matrix.cuda_version }}
+          name: BSRoformer-windows-cuda-${{ matrix.cuda_version }}
           path: release\mel-band-roformer\
           retention-days: 30

+ 16 - 16
CMakeLists.txt

@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 3.17)
-project(mel_band_roformer_cpp VERSION 1.0.0 LANGUAGES CXX)
+project(bs_roformer_cpp VERSION 1.0.0 LANGUAGES CXX)
 
 set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -69,41 +69,41 @@ set(MBR_SOURCES
     src/inference.cpp
 )
 
-add_library(mel_band_roformer STATIC ${MBR_SOURCES})
+add_library(bs_roformer STATIC ${MBR_SOURCES})
 
-target_include_directories(mel_band_roformer PUBLIC
+target_include_directories(bs_roformer PUBLIC
     $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
     $<INSTALL_INTERFACE:include>
 )
-target_include_directories(mel_band_roformer PRIVATE
+target_include_directories(bs_roformer PRIVATE
     ${CMAKE_CURRENT_SOURCE_DIR}/src
 )
 
-target_link_libraries(mel_band_roformer PUBLIC ggml)
+target_link_libraries(bs_roformer PUBLIC ggml)
 if(GGML_CUDA AND TARGET ggml-cuda)
-    target_link_libraries(mel_band_roformer PUBLIC ggml-cuda)
+    target_link_libraries(bs_roformer PUBLIC ggml-cuda)
     
     # Fix for CI: Link against CUDA stubs if the driver is not present
     # This prevents errors like "libcuda.so.1 needed by ... not found" during linking
     find_package(CUDAToolkit REQUIRED)
     if(TARGET CUDA::cuda_driver)
-        target_link_libraries(mel_band_roformer PUBLIC CUDA::cuda_driver)
+        target_link_libraries(bs_roformer PUBLIC CUDA::cuda_driver)
         message(STATUS "Linked against CUDA driver stubs")
     endif()
 endif()
 
 # Compiler options
 if(MSVC)
-    target_compile_options(mel_band_roformer PRIVATE /W3 /utf-8)
+    target_compile_options(bs_roformer PRIVATE /W3 /utf-8)
 else()
-    target_compile_options(mel_band_roformer PRIVATE -Wall -Wextra)
+    target_compile_options(bs_roformer PRIVATE -Wall -Wextra)
 endif()
 
 # OpenMP support
 find_package(OpenMP)
 if(OpenMP_CXX_FOUND)
-    target_link_libraries(mel_band_roformer PUBLIC OpenMP::OpenMP_CXX)
-    target_compile_definitions(mel_band_roformer PUBLIC USE_OPENMP)
+    target_link_libraries(bs_roformer PUBLIC OpenMP::OpenMP_CXX)
+    target_compile_definitions(bs_roformer PUBLIC USE_OPENMP)
     message(STATUS "OpenMP: ENABLED")
 else()
     message(STATUS "OpenMP: NOT FOUND")
@@ -138,21 +138,21 @@ endfunction()
 
 if(MBR_BUILD_CLI)
     # audio.cpp implements AudioFile utilities (using dr_wav)
-    add_executable(mel_band_roformer-cli 
+    add_executable(bs_roformer-cli 
         cli/main.cpp 
         src/audio.cpp
     )
-    target_link_libraries(mel_band_roformer-cli PRIVATE mel_band_roformer)
-    target_include_directories(mel_band_roformer-cli PRIVATE 
+    target_link_libraries(bs_roformer-cli PRIVATE bs_roformer)
+    target_include_directories(bs_roformer-cli PRIVATE 
         src 
         third_party
     )
     
     if(MSVC)
-        target_compile_options(mel_band_roformer-cli PRIVATE /W3 /utf-8)
+        target_compile_options(bs_roformer-cli PRIVATE /W3 /utf-8)
     endif()
     
-    mbr_copy_ggml_dlls(mel_band_roformer-cli)
+    mbr_copy_ggml_dlls(bs_roformer-cli)
 endif()
 
 #================================================

+ 7 - 7
GGML_DEPENDENCY.md

@@ -18,7 +18,7 @@ The CMake configuration resolves GGML dependencies in the following priority ord
 
 Clone GGML as submodule:
 ```bash
-cd MelBandRoformer.cpp
+cd BSRoformer.cpp
 git submodule add https://github.com/ggerganov/ggml.git
 git submodule update --init --recursive
 cmake -B build -DGGML_CUDA=ON
@@ -28,7 +28,7 @@ Or use sibling directory:
 ```bash
 cd ..
 git clone https://github.com/ggerganov/ggml.git
-cd MelBandRoformer.cpp
+cd BSRoformer.cpp
 cmake -B build -DGGML_CUDA=ON
 ```
 
@@ -44,8 +44,8 @@ project(MyParentProject)
 # Build whisper.cpp first (includes ggml)
 add_subdirectory(whisper.cpp)
 
-# Build MelBandRoformer - it will reuse whisper.cpp's ggml target
-add_subdirectory(MelBandRoformer.cpp)
+# Build BSRoformer - it will reuse whisper.cpp's ggml target
+add_subdirectory(BSRoformer.cpp)
 ```
 
 Or use explicit path:
@@ -63,7 +63,7 @@ cmake -B build -DGGML_DIR=/custom/path/to/ggml
 
 **Option A: Submodule** (Recommended)
 ```
-MelBandRoformer.cpp/
+BSRoformer.cpp/
 ├── ggml/                    # Git submodule
 ├── src/
 ├── tests/
@@ -74,7 +74,7 @@ MelBandRoformer.cpp/
 ```
 parent/
 ├── ggml/                    # Shared GGML
-├── MelBandRoformer.cpp/
+├── BSRoformer.cpp/
 └── whisper.cpp/             # Also uses ../ggml
 ```
 
@@ -84,7 +84,7 @@ MyProject/
 ├── external/
 │   └── ggml/
 ├── whisper.cpp/
-├── MelBandRoformer.cpp/
+├── BSRoformer.cpp/
 └── CMakeLists.txt          # Defines ggml target
 ```
 

+ 11 - 11
README.md

@@ -1,4 +1,4 @@
-# MelBandRoformer.cpp
+# BSRoformer.cpp
 
 [中文](README.zh.md) | English
 
@@ -25,12 +25,12 @@ This project is a pure C++ inference engine for the **Mel-Band-Roformer** and **
 ### Download
 
 - **Pre-built Binaries**: Download executables for your platform from the [Releases](../../releases) page
-- **GGUF Models**: Download pre-converted model files from [MelBandRoformer-GGUF](https://huggingface.co/chenmozhijin/MelBandRoformer-GGUF)
+- **GGUF Models**: Download pre-converted model files from [BSRoformer-GGUF](https://huggingface.co/chenmozhijin/BSRoformer-GGUF)
 
 ### Command Line Usage
 
 ```bash
-./mel_band_roformer-cli <model.gguf> <input.wav> <output.wav> [options]
+./bs_roformer-cli <model.gguf> <input.wav> <output.wav> [options]
 
 Options:
   --chunk-size <N>   Chunk size (in samples), defaults to model value
@@ -49,13 +49,13 @@ Options:
 
 ```bash
 # Basic usage (using model defaults)
-./mel_band_roformer-cli model.gguf song.wav vocals.wav
+./bs_roformer-cli model.gguf song.wav vocals.wav
 
 # Custom chunking parameters
-./mel_band_roformer-cli model.gguf song.wav vocals.wav --chunk-size 352800 --overlap 2
+./bs_roformer-cli model.gguf song.wav vocals.wav --chunk-size 352800 --overlap 2
 
 # High quality mode (increase overlap to reduce artifacts)
-./mel_band_roformer-cli model.gguf song.wav vocals.wav --overlap 4
+./bs_roformer-cli model.gguf song.wav vocals.wav --overlap 4
 ```
 
 > **Note**: Input audio must be **44100 Hz**. Stereo or mono is supported (auto-expanded).
@@ -155,8 +155,8 @@ python scripts/convert_to_gguf.py ... --arch bs
 ## 💻 C++ API
 
 ```cpp
-#include <mel_band_roformer/inference.h>
-#include <mel_band_roformer/audio.h>
+#include <bs_roformer/inference.h>
+#include <bs_roformer/audio.h>
 
 // 1. Load audio file
 AudioBuffer input = AudioFile::Load("input.wav");
@@ -184,9 +184,9 @@ AudioFile::Save("vocals.wav", output);
 ## 🏗️ Project Architecture
 
 ```
-MelBandRoformer.cpp/
+BSRoformer.cpp/
 ├── include/
-│   └── mel_band_roformer/
+│   └── bs_roformer/
 │       ├── inference.h        # Inference Engine API
 │       └── audio.h            # Audio I/O API
 ├── src/
@@ -214,7 +214,7 @@ MelBandRoformer.cpp/
 
 ### 1. Model Loading (`model.h/cpp`)
 
-The `MelBandRoformer` class is responsible for:
+The `BSRoformer` class is responsible for:
 
 - **GGUF Weight Loading**: Parsing hyperparameters and tensors from file
 - **Buffer Generation**: `freq_indices`, `num_bands_per_freq`, etc.

+ 11 - 11
README.zh.md

@@ -1,4 +1,4 @@
-# MelBandRoformer.cpp
+# BSRoformer.cpp
 
 中文 | [English](README.md)
 
@@ -25,12 +25,12 @@ Mel-Band-Roformer 音频源分离模型的高性能 C++ 推理实现。
 ### 下载
 
 - **预构建程序**:在 [Releases](../../releases) 页面下载对应平台的可执行文件
-- **GGUF 模型**:在 [MelBandRoformer-GGUF](https://huggingface.co/chenmozhijin/MelBandRoformer-GGUF) 下载预转换的模型文件
+- **GGUF 模型**:在 [BSRoformer-GGUF](https://huggingface.co/chenmozhijin/BSRoformer-GGUF) 下载预转换的模型文件
 
 ### 命令行使用
 
 ```bash
-./mel_band_roformer-cli <模型.gguf> <输入.wav> <输出.wav> [选项]
+./bs_roformer-cli <模型.gguf> <输入.wav> <输出.wav> [选项]
 
 选项:
   --chunk-size <N>   分块大小(采样点数),默认从模型读取
@@ -49,13 +49,13 @@ Mel-Band-Roformer 音频源分离模型的高性能 C++ 推理实现。
 
 ```bash
 # 基本用法(使用模型默认参数)
-./mel_band_roformer-cli model.gguf song.wav vocals.wav
+./bs_roformer-cli model.gguf song.wav vocals.wav
 
 # 自定义分块参数
-./mel_band_roformer-cli model.gguf song.wav vocals.wav --chunk-size 352800 --overlap 2
+./bs_roformer-cli model.gguf song.wav vocals.wav --chunk-size 352800 --overlap 2
 
 # 高质量模式(增加重叠,减少伪影)
-./mel_band_roformer-cli model.gguf song.wav vocals.wav --overlap 4
+./bs_roformer-cli model.gguf song.wav vocals.wav --overlap 4
 ```
 
 > **注意**:输入音频必须为 **44100 Hz**,支持立体声或单声道(自动扩展)。
@@ -155,8 +155,8 @@ python scripts/convert_to_gguf.py ... --arch bs
 ## 💻 C++ API
 
 ```cpp
-#include <mel_band_roformer/inference.h>
-#include <mel_band_roformer/audio.h>
+#include <bs_roformer/inference.h>
+#include <bs_roformer/audio.h>
 
 // 1. 加载音频文件
 AudioBuffer input = AudioFile::Load("input.wav");
@@ -184,9 +184,9 @@ AudioFile::Save("vocals.wav", output);
 ## 🏗️ 项目架构
 
 ```
-MelBandRoformer.cpp/
+BSRoformer.cpp/
 ├── include/
-│   └── mel_band_roformer/
+│   └── bs_roformer/
 │       ├── inference.h        # 推理引擎 API
 │       └── audio.h            # 音频 I/O API
 ├── src/
@@ -214,7 +214,7 @@ MelBandRoformer.cpp/
 
 ### 1. 模型加载 (`model.h/cpp`)
 
-`MelBandRoformer` 类负责:
+`BSRoformer` 类负责:
 
 - **GGUF 权重加载**:从文件解析超参数和张量
 - **缓冲区生成**:`freq_indices`、`num_bands_per_freq` 等

+ 3 - 3
cli/main.cpp

@@ -1,5 +1,5 @@
-#include "mel_band_roformer/inference.h"
-#include "mel_band_roformer/audio.h"
+#include "bs_roformer/inference.h"
+#include "bs_roformer/audio.h"
 #include <iostream>
 #include <string>
 #include <chrono>
@@ -74,7 +74,7 @@ int main(int argc, char* argv[]) {
     }
 
     try {
-        std::cout << "Initializing MelBandRoformer..." << std::endl;
+        std::cout << "Initializing BSRoformer..." << std::endl;
         auto start_time = std::chrono::high_resolution_clock::now();
         
         Inference engine(model_path);

+ 0 - 0
include/mel_band_roformer/audio.h → include/bs_roformer/audio.h


+ 2 - 2
include/mel_band_roformer/inference.h → include/bs_roformer/inference.h

@@ -5,7 +5,7 @@
 #include <memory>
 #include <functional>
 // Forward declaration
-class MelBandRoformer;
+class BSRoformer;
 
 // Forward declaration
 namespace ggml { struct context; struct cgraph; }
@@ -49,7 +49,7 @@ private:
                                                   std::function<void(float)> progress_callback);
 
 private:
-    std::unique_ptr<MelBandRoformer> model_;
+    std::unique_ptr<BSRoformer> model_;
     
     // Persistent Graph State
     struct ggml_context* ctx_ = nullptr;

+ 1 - 1
scripts/generate_test_data.py

@@ -481,7 +481,7 @@ def generate_test_data(
 
 def main():
     parser = argparse.ArgumentParser(
-        description="Generate test data for MelBandRoformer.cpp",
+        description="Generate test data for BSRoformer.cpp",
         formatter_class=argparse.RawDescriptionHelpFormatter,
         epilog=f"""
 Requirements:

+ 1 - 1
src/audio.cpp

@@ -1,6 +1,6 @@
 #define DR_WAV_IMPLEMENTATION
 #include "dr_libs/dr_wav.h"
-#include "mel_band_roformer/audio.h"
+#include "bs_roformer/audio.h"
 #include <iostream>
 
 AudioBuffer AudioFile::Load(const std::string& path) {

+ 2 - 2
src/inference.cpp

@@ -1,4 +1,4 @@
-#include "mel_band_roformer/inference.h"
+#include "bs_roformer/inference.h"
 #include "model.h"
 #include "utils.h"
 #include "stft.h"
@@ -34,7 +34,7 @@ std::vector<float> GetWindow(int size, int fade_size) {
 
 
 Inference::Inference(const std::string& model_path) {
-    model_ = std::make_unique<MelBandRoformer>();
+    model_ = std::make_unique<BSRoformer>();
     model_->Initialize(model_path);
 }
 

+ 13 - 13
src/model.cpp

@@ -8,16 +8,16 @@
 #include <cstring>
 #include <cmath>
 
-MelBandRoformer::MelBandRoformer() {
+BSRoformer::BSRoformer() {
 }
 
-MelBandRoformer::~MelBandRoformer() {
+BSRoformer::~BSRoformer() {
     if (buffer_weights_) ggml_backend_buffer_free(buffer_weights_);
     if (backend_) ggml_backend_free(backend_);
     if (ctx_weights_) ggml_free(ctx_weights_);
 }
 
-void MelBandRoformer::Initialize(const std::string& model_path) {
+void BSRoformer::Initialize(const std::string& model_path) {
     // Use best available backend, but allow forcing CPU
     if (std::getenv("MBR_FORCE_CPU")) {
         backend_ = ggml_backend_init_by_type(GGML_BACKEND_DEVICE_TYPE_CPU, NULL);
@@ -33,7 +33,7 @@ void MelBandRoformer::Initialize(const std::string& model_path) {
     LoadWeights(model_path);
 }
 
-void MelBandRoformer::LoadWeights(const std::string& path) {
+void BSRoformer::LoadWeights(const std::string& path) {
     std::cout << "Loading model from " << path << std::endl;
 
     struct gguf_init_params params = {
@@ -58,16 +58,16 @@ void MelBandRoformer::LoadWeights(const std::string& path) {
     
     // Normalization for legacy models (if any) or simplified internal handling
     if (architecture_ == "bs") architecture_ = "bs_roformer";
-    if (architecture_ == "mel_band") architecture_ = "mel_band_roformer";
+    if (architecture_ == "mel_band") architecture_ = "bs_roformer";
 
-    std::string kp = architecture_ + "."; // key prefix, e.g. "bs_roformer." or "mel_band_roformer."
+    std::string kp = architecture_ + "."; // key prefix, e.g. "bs_roformer." or "bs_roformer."
 
     // Set internal flags based on architecture
     if (architecture_ == "bs_roformer") {
         has_final_norm_ = true;
         transformer_norm_output_ = false;
     } else {
-        // mel_band_roformer
+        // bs_roformer
         has_final_norm_ = false;
         transformer_norm_output_ = true;
     }
@@ -214,11 +214,11 @@ void MelBandRoformer::LoadWeights(const std::string& path) {
     gguf_free(ctx_gguf);
 }
 
-ggml_tensor* MelBandRoformer::GetWeight(const std::string& name) const {
+ggml_tensor* BSRoformer::GetWeight(const std::string& name) const {
     return ggml_get_tensor(ctx_weights_, name.c_str());
 }
 
-std::vector<int> MelBandRoformer::GetDimInputs() const {
+std::vector<int> BSRoformer::GetDimInputs() const {
     std::vector<int> dim_inputs(num_bands_);
     for (int i = 0; i < num_bands_; ++i) {
         int num_freqs = num_freqs_per_band_[i];
@@ -227,7 +227,7 @@ std::vector<int> MelBandRoformer::GetDimInputs() const {
     return dim_inputs;
 }
 
-int MelBandRoformer::GetTotalDimInput() const {
+int BSRoformer::GetTotalDimInput() const {
     if (architecture_ == "bs") {
         // BS: All frequencies * stereo * complex
         int n_freq = n_fft_ / 2 + 1;
@@ -243,7 +243,7 @@ int MelBandRoformer::GetTotalDimInput() const {
 
 // ========== Graph Building Functions ==========
 
-ggml_tensor* MelBandRoformer::BuildBandSplitGraph(
+ggml_tensor* BSRoformer::BuildBandSplitGraph(
     ggml_context* ctx,
     ggml_tensor* input,
     ggml_cgraph* gf,
@@ -311,7 +311,7 @@ ggml_tensor* MelBandRoformer::BuildBandSplitGraph(
     return x;
 }
 
-ggml_tensor* MelBandRoformer::BuildTransformersGraph(
+ggml_tensor* BSRoformer::BuildTransformersGraph(
     ggml_context* ctx,
     ggml_tensor* input,
     ggml_cgraph* gf,
@@ -673,7 +673,7 @@ ggml_tensor* MelBandRoformer::BuildTransformersGraph(
     return x;
 }
 
-ggml_tensor* MelBandRoformer::BuildMaskEstimatorGraph(
+ggml_tensor* BSRoformer::BuildMaskEstimatorGraph(
     ggml_context* ctx,
     ggml_tensor* input,
     ggml_cgraph* gf,

+ 4 - 4
src/model.h

@@ -12,7 +12,7 @@ struct ggml_cgraph;
 struct gguf_context;
 
 /**
- * MelBandRoformer Model
+ * BSRoformer Model
  * 
  * This class handles:
  * 1. Loading weights from GGUF file
@@ -21,10 +21,10 @@ struct gguf_context;
  * 
  * Execution is handled by test/inference code using these graphs.
  */
-class MelBandRoformer {
+class BSRoformer {
 public:
-    MelBandRoformer();
-    ~MelBandRoformer();
+    BSRoformer();
+    ~BSRoformer();
 
     // Initialize model from GGUF file
     void Initialize(const std::string& model_path);

+ 2 - 2
tests/CMakeLists.txt

@@ -1,12 +1,12 @@
 # tests/CMakeLists.txt
-# Test suite for MelBandRoformer
+# Test suite for BSRoformer
 
 #================================================
 # Test Infrastructure
 #================================================
 
 add_library(test_common STATIC test_common.cpp)
-target_link_libraries(test_common PUBLIC mel_band_roformer)
+target_link_libraries(test_common PUBLIC bs_roformer)
 target_include_directories(test_common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
 
 #================================================

+ 2 - 2
tests/README.md

@@ -1,6 +1,6 @@
-# MelBandRoformer Tests
+# MelBandRoformer/BSRoformer Tests
 
-This directory contains the test suite for the MelBandRoformer C++ implementation.
+This directory contains the test suite for the MelBandRoformer/BSRoformer C++ implementation.
 
 ## Test Overview
 

+ 1 - 1
tests/test_audio.cpp

@@ -1,7 +1,7 @@
 #include <iostream>
 #include <vector>
 #include <cmath>
-#include "mel_band_roformer/audio.h"
+#include "bs_roformer/audio.h"
 
 int main() {
     std::cout << "Test: Audio I/O with dr_wav" << std::endl;

+ 1 - 1
tests/test_chunking_logic.cpp

@@ -1,5 +1,5 @@
 #include "test_common.h"
-#include "mel_band_roformer/inference.h"
+#include "bs_roformer/inference.h"
 #include <cstring>
 
 // We need to test the static helper OR the pipeline.

+ 1 - 1
tests/test_common.cpp

@@ -3,7 +3,7 @@
 //======================================================
 // TestContext
 //======================================================
-TestContext::TestContext(MelBandRoformer* m, size_t mem_size) : model(m) {
+TestContext::TestContext(BSRoformer* m, size_t mem_size) : model(m) {
     if (!model) {
         std::cerr << "FATAL: Model is null in TestContext" << std::endl;
         exit(1);

+ 3 - 3
tests/test_common.h

@@ -22,7 +22,7 @@ inline std::string GetTestDataDir() {
 
 inline std::string GetModelPath() {
     const char* env = std::getenv("MBR_MODEL_PATH");
-    return env ? env : "mel_band_roformer.gguf";
+    return env ? env : "bs_roformer.gguf";
 }
 
 inline float GetToleranceAtol() {
@@ -42,10 +42,10 @@ struct TestContext {
     ggml_context* ctx = nullptr;
     ggml_cgraph* gf = nullptr;
     ggml_gallocr_t allocr = nullptr;
-    MelBandRoformer* model = nullptr;
+    BSRoformer* model = nullptr;
     
     // 初始化上下文和图
-    TestContext(MelBandRoformer* m, size_t mem_size = 512 * 1024 * 1024);
+    TestContext(BSRoformer* m, size_t mem_size = 512 * 1024 * 1024);
     
     // 析构自动释放资源
     ~TestContext();

+ 1 - 1
tests/test_component_bandsplit.cpp

@@ -11,7 +11,7 @@ int main(int argc, char* argv[]) {
     if (argc > 2) data_dir = argv[2];
     
     LOG_STEP(1, 4, "Loading model from " + model_path);
-    MelBandRoformer model;
+    BSRoformer model;
     model.Initialize(model_path);
     
     LOG_STEP(2, 4, "Loading golden tensors from " + data_dir);

+ 2 - 2
tests/test_component_layers.cpp

@@ -19,7 +19,7 @@
 
 std::string GetModelPath() {
     const char* env = std::getenv("MBR_MODEL_PATH");
-    return env ? env : "mel_band_roformer.gguf";
+    return env ? env : "bs_roformer.gguf";
 }
 
 std::string GetTestDataDir() {
@@ -41,7 +41,7 @@ int main(int argc, char* argv[]) {
     try {
         // 1. Load Model
         std::cout << "\n[1/6] Loading model..." << std::endl;
-        MelBandRoformer model;
+        BSRoformer model;
         model.Initialize(model_path);
         
         // 2. Load golden tensors

+ 1 - 1
tests/test_component_mask.cpp

@@ -10,7 +10,7 @@ int main(int argc, char* argv[]) {
     if (argc > 2) data_dir = argv[2];
     
     LOG_STEP(1, 4, "Loading model from " + model_path);
-    MelBandRoformer model;
+    BSRoformer model;
     model.Initialize(model_path);
     
     LOG_STEP(2, 4, "Loading golden tensors");

+ 2 - 2
tests/test_inference.cpp

@@ -3,7 +3,7 @@
 #include <cmath>
 #include <string>
 #include <cstdlib>
-#include "mel_band_roformer/inference.h"
+#include "bs_roformer/inference.h"
 #include "../src/utils.h"
 
 /**
@@ -15,7 +15,7 @@
 
 std::string GetModelPath() {
     const char* env = std::getenv("MBR_MODEL_PATH");
-    return env ? env : "mel_band_roformer.gguf";
+    return env ? env : "bs_roformer.gguf";
 }
 
 std::string GetTestDataDir() {