Code Monkey home page Code Monkey logo

encodec.cpp's Introduction

encodec.cpp

encodec.cpp

Actions Status License: MIT

High-performance inference of Meta's Encodec deep learning based audio codec model:

  • Plain C/C++ implementation without dependencies using ggml

Demo

Here is a demo of running Encodec on a single M1 MacBook Pro:

demo.mp4

Roadmap

  • Support of 24Khz model
  • Mixed F16 / F32 precision
  • 4-bit and 8-bit quantization
  • Metal support
  • cuBLAS support

Implementation details

  • The core tensor operations are implemented in C (ggml.h / ggml.c)
  • The encoder-decoder architecture and the high-level C-style API are implemented in C++ (encodec.h / encodec.cpp)
  • Basic usage is demonstrated in main.cpp.

Usage

Here are the steps for the bark model.

Get the code

git clone --recurse-submodules https://github.com/PABannier/encodec.cpp.git
cd encodec.cpp

Build

In order to build encodec.cpp you must use CMake:

mkdir build
cd build
cmake ..
cmake --build . --config Release

Using Metal

Offloading to GPU is possible with the Metal backend for MacOS. Performance are not improved but the power consumption and CPU activity is reduced.

cmake -DGGML_METAL=ON -DBUILD_SHARED_LIBS=Off ..
cmake --build . --config Release

Using cuBLAS

The inference can be offloaded on a CUDA backend with cuBLAS.

cmake -DGGML_CUBLAS=ON -DBUILD_SHARED_LIBS=Off ..
cmake --build . --config Release

encodec.cpp's People

Contributors

bachittle avatar pabannier avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.