Integration to a typescript mern stack web-app
When I do npm install xenova/transformers.js#v3
And add the imports
import { AutoTokenizer, MusicgenForConditionalGeneration } from '@xenova/transformers';
The "@xenova/transformers" module doesn't get resolved.
Do I have configure something else?
Thank you, that works now.
Hello, I'm having trouble again this time I was following the source code for the Web demo.
I am trying to encode the generated audio to a wave file. But I am met with this error
Error | | Code
Property 'audio_encoder' does not exist on type 'PretrainedConfig'.ts(2339)
->const sampling_rate = model.config.audio_enconder.sampling_rate;
My setup is Vite and TypeScript. Do I have to configure tsconfig.json?
I tried looking at the docs but to no avail.
there appears to be a typo:
- const sampling_rate = model.config.audio_enconder.sampling_rate;
+ const sampling_rate = model.config.audio_encoder.sampling_rate;
But also, you may just need to ts-ignore the type error since we don't specify all possibilities for pretrained configs currently.
Thanks for your continued responses, I was able to solve my issues before!
From my end, I notice that there is a significant delay in loading the model (4-5s) and generating the music(about 120s on average).
When I test the same parameters in your demo, I see that the demo is about 1.5x faster than mine. And that the progress bar updates during music generation. Why is that?
When using this model is there any configurations I can do from my end(code?)?
I run this via npm run dev