Datasets:
Download source/scripts/eval_parakeet.py from lance-format/small-overlapping-speech-bench-lance: direct link, hf CLI and curl.
- Browser
- Download file 764 Bytes
-
https://huggingface.co/datasets/lance-format/small-overlapping-speech-bench-lance/resolve/refs%2Fpr%2F1/source/scripts/eval_parakeet.py
- Command line
-
hf download hf://datasets/lance-format/small-overlapping-speech-bench-lance@refs/pr/1/source/scripts/eval_parakeet.py
-
curl -L -o eval_parakeet.py https://huggingface.co/datasets/lance-format/small-overlapping-speech-bench-lance/resolve/refs%2Fpr%2F1/source/scripts/eval_parakeet.py
764 Bytes
| import os, sys, json, time | |
| os.environ["HF_HUB_DISABLE_XET"]="1"; sys.modules["flash_attn"]=None | |
| sys.path.insert(0,"/mnt/nvme/uvp/repo") | |
| from pipeline.asr_parakeet import ParakeetSortformerASR | |
| idx=json.load(open("/mnt/nvme/uvp/overlap_testset/index.json")) | |
| asr=ParakeetSortformerASR(asr_device="cuda:0", diar_device="cuda:1") | |
| out={} | |
| for i,it in enumerate(idx): | |
| diar=asr._diarize(it["wav"]); words=asr._transcribe(it["wav"]) | |
| text=" ".join(w["word"] for w in words) | |
| nspk=len(set(d["speaker"] for d in diar)) if diar else 0 | |
| out[it["clip_id"]]={"text":text,"n_speakers":nspk} | |
| if i%20==0: print(f" {i}/100",flush=True) | |
| json.dump(out,open("/mnt/nvme/uvp/overlap_testset/asr_out/parakeet.json","w"),ensure_ascii=False,indent=2) | |
| print("PARAKEET DONE") | |