Git Product home page Git Product logo

Comments (11)

prajwalkr avatar prajwalkr commented on May 19, 2024 2

I am sorry, as I said, I do not know about JIT containers...can you paste any link here, please? Thank you so much for the quick replies!

from silero-models.

snakers4 avatar snakers4 commented on May 19, 2024

We do not provide this feature out of the box
But you can just modify the model code

from silero-models.

prajwalkr avatar prajwalkr commented on May 19, 2024

I am unable to find the code for the model. Sorry, I am new to torch hub and torchscript

from silero-models.

snakers4 avatar snakers4 commented on May 19, 2024

It is public within the jit containers

from silero-models.

snakers4 avatar snakers4 commented on May 19, 2024

can you paste any link here, please?

This one for example - https://github.com/snakers4/silero-models/blob/master/models.yml#L9
This is what is loaded under the hood

from silero-models.

snakers4 avatar snakers4 commented on May 19, 2024

Adding a model with skip connections may be a good idea for a v3
But maintaining _q / onnx flavors of this would be a chore

from silero-models.

prajwalkr avatar prajwalkr commented on May 19, 2024

This is what is loaded under the hood

Loading the model using torch.jit.load and accessing .code gives:

def forward(self,\n x: Tensor,\n calibrate: bool=False) -> Tensor:\n _0 = self.n_fft\n _1 = self.hop_length\n _2 = self.win_length\n _3 = torch.hann_window(self.n_fft, dtype=ops.prim.dtype(x), layout=None, device=ops.prim.device(x), pin_memory=None)\n x0 = __torch__.torch.functional.stft(x, _0, _1, _2, _3, True, "reflect", False, True, )\n _4 = torch.slice(x0, 0, 0, 9223372036854775807, 1)\n _5 = torch.slice(_4, 1, 0, 9223372036854775807, 1)\n _6 = torch.slice(_5, 2, 0, 9223372036854775807, 1)\n x_real = torch.select(_6, 3, 0)\n _7 = torch.slice(x0, 0, 0, 9223372036854775807, 1)\n _8 = torch.slice(_7, 1, 0, 9223372036854775807, 1)\n _9 = torch.slice(_8, 2, 0, 9223372036854775807, 1)\n x_imag = torch.select(_9, 3, 1)\n _10 = torch.add(torch.pow(x_real, 2), torch.pow(x_imag, 2), alpha=1)\n x1 = torch.sqrt(_10)\n x2 = (self.audio_normalize).forward(x1, )\n x3 = (self.quant).forward(x2, )\n x4 = (self.encoder).forward(x3, )\n x5 = (self.dequant).forward(x4, )\n _11 = self.decoder\n _12 = torch.contiguous(torch.permute(x5, [2, 0, 1]), memory_format=0)\n _13 = torch.permute((_11).forward(_12, None, None, ), [1, 2, 0])\n x6 = torch.contiguous(_13, memory_format=0)\n x7 = (self.fc).forward(x6, )\n x8 = torch.contiguous(torch.transpose(x7, 1, 2), memory_format=0)\n return (self.softmax).forward(x8, )

How can I get the "non-jit" style code?

from silero-models.

snakers4 avatar snakers4 commented on May 19, 2024

How can I get the "non-jit" style code?

We have not published the original code of our models for a number of reasons
More human readable code can be found just inside of jit containers (they are just pickled zips or vice versa)

from silero-models.

prajwalkr avatar prajwalkr commented on May 19, 2024

Okay. So, how can I modify the above non-human readable code to return at a specific point in the forward pass? I just want to return the output before the FC layer.

from silero-models.

snakers4 avatar snakers4 commented on May 19, 2024

these models were not really meant to be modified
if you would like to modify them anyway - please look inside of the containers manually (they should look like folders)

from silero-models.

Sindhu-Hegde avatar Sindhu-Hegde commented on May 19, 2024

Can you please let me know how to get the previous layer's output, just before FC? I want the output from the decoder, i.e, when I call model(input), I want the model to return the decoder's output instead of softmax probabilities.

from silero-models.

Related Issues (20)

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.