You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[18], line 2
1 BATCH_SIZE = 10
----> 2 transcriptions = model.transcribe(segments, batch_size=BATCH_SIZE)[0]
File /opt/conda/envs/gigaam/lib/python3.10/site-packages/torch/utils/_contextlib.py:116, in context_decorator.<locals>.decorate_context(*args, **kwargs)
113 @functools.wraps(func)
114 def decorate_context(*args, **kwargs):
115 with ctx_factory():
--> 116 return func(*args, **kwargs)
File /opt/conda/envs/gigaam/lib/python3.10/site-packages/nemo/collections/asr/models/rnnt_models.py:286, in EncDecRNNTModel.transcribe(self, paths2audio_files, batch_size, return_hypotheses, partial_hypothesis, num_workers, channel_selector, augmentor, verbose)
284 for audio_file in paths2audio_files:
285 entry = {'audio_filepath': audio_file, 'duration': 100000, 'text': ''}
--> 286 fp.write(json.dumps(entry) + '\n')
288 config = {
289 'paths2audio_files': paths2audio_files,
290 'batch_size': batch_size,
(...)
293 'channel_selector': channel_selector,
294 }
296 if augmentor:
File /opt/conda/envs/gigaam/lib/python3.10/json/__init__.py:231, in dumps(obj, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, sort_keys, **kw)
226 # cached encoder
227 if (not skipkeys and ensure_ascii and
228 check_circular and allow_nan and
229 cls is None and indent is None and separators is None and
230 default is None and not sort_keys and not kw):
--> 231 return _default_encoder.encode(obj)
232 if cls is None:
233 cls = JSONEncoder
File /opt/conda/envs/gigaam/lib/python3.10/json/encoder.py:199, in JSONEncoder.encode(self, o)
195 return encode_basestring(o)
196 # This doesn't pass the iterator directly to ''.join() because the
197 # exceptions aren't as detailed. The list call should be roughly
198 # equivalent to the PySequence_Fast that ''.join() would do.
--> 199 chunks = self.iterencode(o, _one_shot=True)
200 if not isinstance(chunks, (list, tuple)):
201 chunks = list(chunks)
File /opt/conda/envs/gigaam/lib/python3.10/json/encoder.py:257, in JSONEncoder.iterencode(self, o, _one_shot)
252 else:
253 _iterencode = _make_iterencode(
254 markers, self.default, _encoder, self.indent, floatstr,
255 self.key_separator, self.item_separator, self.sort_keys,
256 self.skipkeys, _one_shot)
--> 257 return _iterencode(o, 0)
File /opt/conda/envs/gigaam/lib/python3.10/json/encoder.py:179, in JSONEncoder.default(self, o)
160 def default(self, o):
161 """Implement this method in a subclass such that it returns
162 a serializable object for ``o``, or calls the base implementation
163 (to raise a ``TypeError``).
(...)
177
178 """
--> 179 raise TypeError(f'Object of type {o.__class__.__name__} '
180 f'is not JSON serializable')
TypeError: Object of type ndarray is not JSON serializable
According segment_audio function, segments are numpy array. But method model.transcribe waits paths.
Can you fix mistake in example and give code example to process long audios?
The text was updated successfully, but these errors were encountered:
I try to use GigaAM-rnnt according this example https://colab.research.google.com/github/salute-developers/GigaAM/blob/main/examples/notebooks/GigaAM_RNNT_Model_Usage_Example.ipynb#scrollTo=nlrRmRPvKxYq
But i have error in this part
Error:
According
segment_audio
function, segments are numpy array. But methodmodel.transcribe
waits paths.Can you fix mistake in example and give code example to process long audios?
The text was updated successfully, but these errors were encountered: