-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate Whisper model with hg
evaluation CLI interface
#740
Conversation
I noticed that running the evaluation with Additionally, I found that the text data was being encoded only to be decoded again, so I eliminated this redundant step from the pipeline, along with making other refactoring adjustments. Edit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR !
I can see you have made attempts to remove duplicates from the first iteration and parameterize some functions such as prepare_dataset()
, load_asr_evaluator()
, etc.
I think we need a few more building blocks to make this PR a solid one (dynamic loading of HG model and processor, improve the AsrEvalConfig
to cover output_dir
, better handling of inline functions). There should be a separate PR to handle the HG model loader, too, but let's discuss this point in our call
) | ||
|
||
|
||
class HGModelWrapper: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought: A better way to handle this is to have a HG model loader with HG model config, where we can specify the transformers class and the preprocessor class. But this can be left to another PR
wall_watch = Stopwatch(start=True, device=init_device) | ||
|
||
return HFEvaluator[Seq2SeqBatch]( | ||
model=cast(Model, HGModelWrapper(model)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my other comment.
This forced casting is artificial IMHO - The better option is to create a model loader that creates a HG model out of its name. But let's make it in a separate PR.
I will close this PR in favor of 2 smaller PRs
I will address all comments on the new PRs |
What does this PR do? Please describe:
This PR adds integration for whisper model with the
hg
evaluation CLI interface.In the process, I have refactored some functions to be more generic and support huggingface transformers API.
Demo:
Does your PR introduce any breaking changes? If yes, please list them:
Hopefully none.
Check list: