File size: 549 Bytes
54d1502
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from optimum.intel import OVModelForAudioFrameClassification
from transformers import AutoFeatureExtractor, pipeline

# model_id should be set to either a local directory or a model available on the HuggingFace hub.
model_id = "helenai/anton-l-wav2vec2-base-superb-sd-ov"
feature_extractor = AutoFeatureExtractor.from_pretrained(model_id, trust_remote_code=True)
model = OVModelForAudioFrameClassification.from_pretrained(model_id)
pipe = pipeline("None", model=model, feature_extractor=feature_extractor)
result = pipe("hello world")
print(result)