helenai's picture
commit files to HF hub
54d1502
raw
history blame contribute delete
549 Bytes
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)