Skip to content

Updated the audiogen application to use the LiteRT API#199

Open
gmiodice wants to merge 4 commits into
mainfrom
audiogen_litert
Open

Updated the audiogen application to use the LiteRT API#199
gmiodice wants to merge 4 commits into
mainfrom
audiogen_litert

Conversation

@gmiodice
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Comment thread kleidiai-examples/audiogen/app/audiogen.cpp Outdated
Comment thread kleidiai-examples/audiogen/app/CMakeLists.txt Outdated
Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Comment thread kleidiai-examples/audiogen/app/audiogen.cpp Outdated
std::string autoencoder_encoder_tflite = models_base_path + "/autoencoder_encoder_model.tflite";
std::string sentence_model_path = models_base_path + "/spiece.model";

auto env = get_litert_value(litert::Environment::Create({}));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think you need to create new Environment here.

encode_audio() gets env as parameter and you can keep using it.

Comment thread kleidiai-examples/audiogen/app/audiogen.cpp Outdated
memcpy(dit_globalcond_in_data, t5_globalcond_out_data, get_num_elems(dit_globalcond_in_dims) * sizeof(float));
// Copy T5 outputs to DiT inputs (constants for diffusion loop)
{
auto t5_cross_ptr = get_litert_value(t5_outputs[k_t5_crossattn_out_idx].Lock(litert::TensorBuffer::LockMode::kRead));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

you don't need to deep copy the content of TensorBuffer.
You can create virtual copy of the T5 outputs TensorBuffer using TensorBuffer::Duplicate().
And use it as inputs of Dit model. I've added an example here: google-ai-edge/LiteRT#7302


- **input_audio_path (-i)**: Add input audio file for style transfer
- **sigma_max (-x)**: A hyper parameter to tweak noise level No newline at end of file
- **sigma_max (-x)**: A hyper parameter to tweak noise level
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you add some e2e example how to use this tool?

Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Copy link
Copy Markdown

@terryheo terryheo left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my feedback!

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.

3 participants