Comments (8)
@P15V make sure that there are no line breaks between the curly brackets. I believe this will solve your error
nemo manifests despite being saved as .json are a bit fiddly at times and cannot be directly loaded in via the json package. each line within the manifest should be a complete json string.
I think the error is occurring because it is trying to read the 2nd line as a json string, but because you have line breaks within the curly brackets the 2nd line is not a valid json string on its own.
from nemo.
This is the right answer, we read a file as a jsonl, though we (wrongly) call it a .json file. We'll attempt to make the parsing logic a bit more robust in the future, and log an appropriate warning instead of crashing. Fyi @stevehuang52
from nemo.
And directly fixing the errors with the JSON file directly, leads to this error:
"-packages/nemo/collections/common/data/lhotse/nemo_adapters.py", line 84, in iter
text=data[self.text_field],
KeyError: 'answer'
to fix this, please modify the input lines file to add 'answer' field.
{
"audio_filepath": "PathRemovedDueToPersonalName",
"duration": 30.0,
"taskname": "asr",
"source_lang": "en",
"target_lang": "en",
"pnc": 'yes',
"answer": 'na',
}
also, we recently updated .transcribe
signature, so if you are using main branch
transcript = canary_model.transcribe(paths2audio_files="/home/pjstimac/NvidiaCanaryTest/transcribe_manifest.json", batch_size=16)
should be updated to
transcript = canary_model.transcribe(audio="/home/pjstimac/NvidiaCanaryTest/transcribe_manifest.json", batch_size=16)
from nemo.
The notebook above is not the way to do inference for Canary, it's for beam search with CTC models, and is a deprecated notebook in general.
from nemo.
Glad it worked. We'll iron out these issues in the pre-release. It shouldn't be so difficult to do inference
from nemo.
Hello all,
Thanks for your time & replies; I can't express how much I genuinely appreciate it!! :)
So after I made this post, I went home and tried all night on my personal time; still no luck unfortunately.
I found that "answer: 'na' " key via the Hugging face documentation and included that.
@krishnacpuvvada, @LL-AI-dev Running that format JSON, with the updated transcript variable, still prints out the json error:
"json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 1 (char 2)"
I go off the error, and correct that with the JSON, and still get this error (and ran into this last night as well)
" assert isinstance(cut, MonoCut), "Expected MonoCut."
AssertionError: Expected MonoCut."
Tried both a JSON & JSONL file, same result :
" assert isinstance(cut, MonoCut), "Expected MonoCut."
AssertionError: Expected MonoCut."
My updated code with that updated variable:
"" # Load Canary model
from nemo.collections.asr.models import EncDecMultiTaskModel
canary_model = EncDecMultiTaskModel.from_pretrained('nvidia/canary-1b')
transcript = canary_model.transcribe(audio="/home/NameRemoved/NvidiaCanaryTest/transcribed_manifest.jsonl", batch_size=16) ""
Last night, I thought, let's try the tutorial Google Colab Notebooks right from the Nvidia website for any NeMo model...
Not even that could run all the way through right on google colab.
"https://colab.research.google.com/github/NVIDIA/NeMo/blob/stable/tutorials/asr/Offline_ASR.ipynb"
It was error out at this variable "paths2audio_files=files"
Thanks for everyone's time; much appreciated!!!! :D
from nemo.
@titu1994 Well that would explain it! After much trial and error, I finally got it running in a notebook & python shell. with 3 lines of code, skipping the JSON/JSONL manifest entirely:
""
import nemo.collections.asr as nemo_asr
nemoasr_model = nemo_asr.models.EncDecCTCModelBPE.from_pretrained("nvidia/canary-1b")
nemoasr_model.transcribe(['AudioClipDirectly.wav'])
""
Once that was working, I just wrote a Python loop to loop through an audio directory and output the transcription results to a JSON for my viewing/model comparison setup app.
Thanks for all the attempts at help though, @titu1994 & @krishnacpuvvada. I genuinely appreciate it!! Wish the documentation was better so I would not have had to bother you guys, oh well.
be well!!! :D
from nemo.
@titu1994 That would be so great to see!! I've been playing around with Whisper for the past few months, and this was unexpectedly annoying to get going in comparison.
the code is simple enough looking at it; the documentation though, is a different story. But it's going now on my end, yay!! :) Thanks again for the input and help @krishnacpuvvada & @titu1994 , much appreciated!!
from nemo.
Related Issues (20)
- Speaker Diarization Inference: cuda=False, using CPU for eigen decomposition when creating model from NeuralDiarizer.from_pretrained() HOT 2
- FileNotFoundError: Model stt_zh_citrinet_1024_gamma_0_25 was not found. Check cls.list_available_models() for the list of all available models. HOT 2
- Unable to export diar_msdd_telephonic (neural diarizer) model to onnx format HOT 5
- ASR: Disfluency Detection / Sentence Completion HOT 1
- Missing Support for MultiStepLR in NeMo Framework HOT 1
- Error in Tacotron2 Training: Reached max decoder steps 1000
- Fastconformer loss reduction method for gradient accumulation HOT 5
- Can I finetune from a sub-word based model to a character based model ? HOT 2
- Tutorial BUG HOT 2
- AttributeError: module 'nemo.core.classes' has no attribute 'dataset' HOT 3
- No disk space left while loading llama2-70B for SFT HOT 9
- cannot load reward model from SFT model because of missing keys
- Regarding the ready to use .nemo models for PEFT finetuning HOT 5
- How much latency does the MARBLENET VAD model have in segment-level speech prediction? HOT 1
- TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' HOT 1
- ImportError: Apex was not found. Please see the NeMo README for installation instructions: https://github.com/NVIDIA/NeMo#megatron-gpt.
- Multilingual FastConformer change vocabulary test WER > 1 but validation WER = 0.16 HOT 6
- Issue while importing-> from nemo.collections import nlp HOT 1
- Why there is no speaker labels provided with the pretrained model Titanet large from NGC cloud? HOT 2
- Getiing an error called ModuleNotFoundError: No module named 'packaging'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nemo.