Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' #8800

Closed
Johncenacme opened this issue Apr 3, 2024 · 2 comments
Closed
Labels
bug Something isn't working stale

Comments

@Johncenacme
Copy link

import os
import wget
from omegaconf import OmegaConf
import json
import shutil
from faster_whisper import WhisperModel
import whisperx
import torch
from pydub import AudioSegment
from nemo.collections.asr.models.msdd_models import NeuralDiarizer
from deepmultilingualpunctuation import PunctuationModel
import re
import logging
import nltk
from whisperx.alignment import DEFAULT_ALIGN_MODELS_HF, DEFAULT_ALIGN_MODELS_TORCH
from whisperx.utils import LANGUAGES, TO_LANGUAGE_CODE


TypeError Traceback (most recent call last)
Input In [18], in <cell line: 10>()
8 import torch
9 from pydub import AudioSegment
---> 10 from nemo.collections.asr.models.msdd_models import NeuralDiarizer
11 from deepmultilingualpunctuation import PunctuationModel
12 import re

File ~/anaconda3/lib/python3.9/site-packages/nemo/collections/asr/init.py:15, in
1 # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
(...)
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
---> 15 from nemo.collections.asr import data, losses, models, modules
16 from nemo.package_info import version
18 # Set collection version equal to NeMo version.

File ~/anaconda3/lib/python3.9/site-packages/nemo/collections/asr/models/init.py:15, in
1 # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
(...)
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
---> 15 from nemo.collections.asr.models.asr_model import ASRModel
16 from nemo.collections.asr.models.audio_to_audio_model import AudioToAudioModel
17 from nemo.collections.asr.models.classification_models import EncDecClassificationModel, EncDecFrameClassificationModel

File ~/anaconda3/lib/python3.9/site-packages/nemo/collections/asr/models/aed_multitask_models.py:31, in
28 from torchmetrics.text import SacreBLEUScore
29 from tqdm.auto import tqdm
---> 31 from nemo.collections.asr.data.audio_to_text_lhotse_prompted import (
32 PromptedAudioToTextLhotseDataset,
33 get_prompt_format_fn,
34 )
35 from nemo.collections.asr.models.asr_model import ASRModel, ExportableEncDecModel
36 from nemo.collections.asr.parts.mixins import ASRBPEMixin

File ~/anaconda3/lib/python3.9/site-packages/nemo/collections/asr/data/audio_to_text_lhotse_prompted.py:22, in
19 from lhotse.dataset import AudioSamples
20 from lhotse.dataset.collation import collate_vectors
---> 22 from nemo.collections.asr.data.audio_to_text_lhotse import TokenizerWrapper
23 from nemo.collections.common.tokenizers import CanaryTokenizer, TokenizerSpec
26 class PromptedAudioToTextLhotseDataset(torch.utils.data.Dataset):

File ~/anaconda3/lib/python3.9/site-packages/nemo/collections/asr/data/audio_to_text_lhotse.py:59, in
55 tokens = collate_vectors(tokens, padding_value=0)
56 return audio, audio_lens, tokens, token_lens
---> 59 class TokenizerWrapper:
60 """
61 Provide a unified interface for NeMo Tokenizer, AggregateTokenizer, and (char) Parser.
62 """
64 def init(self, tokenizer):

File ~/anaconda3/lib/python3.9/site-packages/nemo/collections/asr/data/audio_to_text_lhotse.py:73, in TokenizerWrapper()
70 else:
71 self._impl = self._call_parser
---> 73 def call(self, text: str, lang: str | None = None):
74 return self._impl(text, lang)
76 def _call_agg_tokenizer(self, text: str, lang: str | None = None):

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

this is what is got while importing the above ones

@Johncenacme Johncenacme added the bug Something isn't working label Apr 3, 2024
@nithinraok
Copy link
Collaborator

Please use python 3.10, this is issue with mismatch of versions of python

Copy link
Contributor

github-actions bot commented May 5, 2024

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants