Upload benchmark.py with huggingface_hub
Browse files3 unmodified lines456789109 unmodified lines20212223242526272829303132333457 unmodified lines929394959697983 unmodified linesclassifier hears the expressions in the released samples, and the ONNX speedon the CPU.DIZIONE_DATA=release/phonemizer MAYA_MINI_FRONTEND=own python benchmark.py release"""import json9 unmodified linesfrom scipy.signal import resample_polyfrom transformers import ASTFeatureExtractor, ASTForAudioClassificationfrom maya_mini.infer import load_model, speakfrom maya_mini.text import EXPRESSIONS, phonemizeTHREADS = 4EVENT_MODEL_ID = "MIT/ast-finetuned-audioset-10-10-0.4593"# AudioSet classes that count as hearing each expression, as in generate.py.EVENT_LABELS = {"sigh": ["Sigh", "Breathing"], "exhale": ["Sigh", "Breathing"], "gasp": ["Gasp", "Breathing"]}SENTENCES = ("Hello! This is maya mini.","The weather is nice today, and I feel very relaxed.","Did you really pay forty two dollars for that on March third?","After a long journey across the mountains, the travellers reached the small village, where they were welcomed.",57 unmodified linesdef main() -> None:release = Path(sys.argv[1])model = load_model(release / "maya-mini.pt")config = model.configreport = {"expression_seconds": expression_lengths(model, config.hop / config.sample_rate),3 unmodified lines456789109 unmodified lines20212223242526272829303132333457 unmodified lines929394959697983 unmodified linesclassifier hears the expressions in the released samples, and the ONNX speedon the CPU.DIZIONE_DATA=release/phonemizer FIATO_FRONTEND=own python benchmark.py release"""import json9 unmodified linesfrom scipy.signal import resample_polyfrom transformers import ASTFeatureExtractor, ASTForAudioClassificationfrom fiato.infer import load_model, speakfrom fiato.text import EXPRESSIONS, phonemizeTHREADS = 4EVENT_MODEL_ID = "MIT/ast-finetuned-audioset-10-10-0.4593"# AudioSet classes that count as hearing each expression, as in generate.py.EVENT_LABELS = {"sigh": ["Sigh", "Breathing"], "exhale": ["Sigh", "Breathing"], "gasp": ["Gasp", "Breathing"]}SENTENCES = ("Hello! This is fiato.","The weather is nice today, and I feel very relaxed.","Did you really pay forty two dollars for that on March third?","After a long journey across the mountains, the travellers reached the small village, where they were welcomed.",57 unmodified linesdef main() -> None:release = Path(sys.argv[1])model = load_model(release / "fiato.pt")config = model.configreport = {"expression_seconds": expression_lengths(model, config.hop / config.sample_rate),
benchmark.py+5-5