Skip to content

Adding fp16 mode whisper #244

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Adding fp16 mode whisper #244

wants to merge 3 commits into from

Conversation

kkontny
Copy link
Contributor

@kkontny kkontny commented Apr 25, 2024

Adds support for naitive FP16 in whisper OpenAI model.

@jan-grzybek-ampere
Copy link
Member

@dkupnicki please review

Copy link
Collaborator

@dkupnicki dkupnicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python3 run.py -m small -p fp16 should start the model in the fp16 mode, but fails.

Adding something like:

parser.add_argument("-p", "--precision", type=str, choices=["fp32", "fp16"], required=True)

args = vars(parser.parse())
if torch.cuda.is_available():
    run_pytorch_cuda(**args)
elif args["precision"] == "fp32":
    run_pytorch_fp32(**args)
elif args["precision"] == "fp16":
    run_pytorch_fp16(**args)

and modifying run_pytorch_fp32 and run_pytorch_fp16 to accept **kwargs should work.
Or add require_precision() to DefaultArgParser in utils/helpers.py

@kkontny kkontny force-pushed the karol/whisper-fp16 branch from 56b34fb to d837526 Compare May 7, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants