from optimum.intel import OVModelForCTC | |
from transformers import AutoProcessor, pipeline | |
# model_id should be set to either a local directory or a model available on the HuggingFace hub. | |
model_id = "helenai/facebook-hubert-large-ls960-ft-ov" | |
feature_extractor = AutoProcessor.from_pretrained(model_id) | |
model = OVModelForCTC.from_pretrained(model_id) | |
pipe = pipeline("automatic-speech-recognition", model=model, feature_extractor=feature_extractor) | |
result = pipe("hello world") | |
print(result) | |