Changeset 36867


Ignore:
Timestamp:
2022-10-28T10:27:21+13:00 (6 weeks ago)
Author:
davidb
Message:

the result of checking out and running this extension using the new self-contained python3

Location:
gs3-extensions/structured-audio/trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/structured-audio/trunk/bin/script/diarization.py

    r36211 r36867  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22from pyannote.audio import Pipeline
    33from pathlib import Path
     
    66# remove available graphic cards to trigger cpu default
    77os.environ["CUDA_VISIBLE_DEVICES"] = ""
     8
     9from huggingface_hub import HfApi
     10available_pipelines = [p.modelId for p in HfApi().list_models(filter="pyannote-audio-pipeline")]
     11print(available_pipelines)
    812
    913parser = argparse.ArgumentParser()
     
    2731    FILEIN = {'audio': fileName}
    2832    fileName, fileExtension = os.path.splitext(fileName)
    29     pipeline = Pipeline.from_pretrained('pyannote/speaker-diarization')
     33    pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization")
    3034    diarization = pipeline(FILEIN)
    3135    try:
Note: See TracChangeset for help on using the changeset viewer.