serve icon indicating copy to clipboard operation
serve copied to clipboard

Add handler for audio models with an example

Open chauhang opened this issue 6 years ago • 9 comments

Add new handler for audio models along with an example for pre / post processing of audio data.

chauhang avatar Feb 21 '20 08:02 chauhang

We are unable to get any pre-trained audio model. Is it possible to get any pre-trained audio model for this? There is WaveGlow based model which is a text to audio model however not a pure audio model.

codinnvrends avatar Mar 03 '20 05:03 codinnvrends

@dhaniram-kshirsagar Please add the example for WaveGlow based model to examples.

mycpuorg avatar Mar 03 '20 19:03 mycpuorg

Added waveglow based text to speech synthesizer example in stage_release branch.

Commit : https://github.com/pytorch/serve/commit/08483a41525bc66e8872a49806a484b2a76a706a

harshbafna avatar Mar 04 '20 15:03 harshbafna

There were some documentation issues, which I just fixed in-place.

The .pth file that's supposed to contain the model comes back empty. To wit:

> curl -0 https://api.ngc.nvidia.com/v2/models/nvidia/waveglowpyt_fp32/versions/1/files/nvidia_waveglowpyt_fp32_20190306.pth > nvidia_waveglowpyt_fp32_20190306.pth
...
> ls -l
-rw-rw-r-- 1 ubuntu ubuntu     0 Mar  5 20:45 nvidia_waveglowpyt_fp32_20190306.pth

I tried a few variations, including pulling the model down from the PyTorch hub, but couldn't get anything to work. This was on a p2.xlarge instance.

fbbradheintz avatar Mar 05 '20 20:03 fbbradheintz

@fbbradheintz : the nvidia_waveglowpyt_fp32_20190306.pth url internally redirects to s3 location. You need to use -L flag with the curl command to handle redirction.

curl -L https://api.ngc.nvidia.com/v2/models/nvidia/waveglowpyt_fp32/versions/1/files/nvidia_waveglowpyt_fp32_20190306.pth > nvidia_waveglowpyt_fp32_20190306.pth

Or use the wget command :

wget https://api.ngc.nvidia.com/v2/models/nvidia/waveglowpyt_fp32/versions/1/files/nvidia_waveglowpyt_fp32_20190306.pth > nvidia_waveglowpyt_fp32_20190306.pth

harshbafna avatar Mar 06 '20 05:03 harshbafna

I'll give that a try. Please document this, as some people will be trying this from a terminal environment.

fbbradheintz avatar Mar 09 '20 19:03 fbbradheintz

The speech synthesis example worked for me, once I had the model downloaded correctly.

Please close after merging.

fbbradheintz avatar Mar 09 '20 19:03 fbbradheintz

Reopening and adding v0.11 milestone

adityabindal avatar Apr 23 '20 15:04 adityabindal

As noted in a comment on #258, there is one other item: At the team status meeting today, it was raised that this is not really a complete example, as it stashes the output in a file in /tmp - which does the requester no good if they're on another machine. To make the example truly valuable, it should package the file for download with the HTTP response.

fbbradheintz avatar Apr 29 '20 19:04 fbbradheintz