Translator.__init__() got an unexpected keyword argument 'sample_rate'

#12
by adv123 - opened

I am trying to clone on private space (Nvidia T4 Medium) but I got this error below. What should I do?

Runtime error

==========
== CUDA ==

CUDA Version 11.7.1

Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

Traceback (most recent call last):
File "/home/user/app/app.py", line 42, in
translator = Translator(
TypeError: Translator.init() got an unexpected keyword argument 'sample_rate'

Translator does not accept "sample_rate" anymore. Pass "sample_rate" to Translator.predict instead

Where? I just clicked “duplicate space for private use” button.

Oh. Never mind, my suggestion requires some code changes. Nothing fixable via clicking around

Does it mean is bugged the source version ?

no, it means API surface for Translator has changed. so demo does not work with the updated version.

'dtype' has to be added and 'sample_rate' has to be removed from Translator in app.py. (optionally, add it to the predict fn)

line 42:

translator = Translator(
    model_name_or_card="seamlessM4T_large",
    vocoder_name_or_card="vocoder_36langs",
    device=device,
    dtype=torch.float32
)

and line 78:

text_out, wav, sr = translator.predict(
    input=input_data,
    task_str=task_name,
    tgt_lang=target_language_code,
    src_lang=source_language_code,
    ngram_filtering=True,
    sample_rate=AUDIO_SAMPLE_RATE
)

Could someone be able to commit this fix so that other people will be able to close the space privately ?

Could someone be able to commit this fix so that other people will be able to close the space privately ?

better to duplicate the space and apply the changes on your private space.

Sign up or log in to comment