Skip to content
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

Add genai notebook for whisper scenario #2406

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

Conversation

sbalandi
Copy link
Contributor

Task CVS-147995

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@sbalandi
Copy link
Contributor Author

sbalandi commented Sep 24, 2024

openvino.genai was built from PR openvinotoolkit/openvino.genai#883 and install openvino.genai by this way:

git clone --recursive https://github.com/openvinotoolkit/openvino.genai.git
git remote add whisper https://github.com/as-suvorov/openvino.genai.git
git fetch whisper
git checkout as/whisper-language-task-modes
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
set OpenVINO_DIR=whisper_venv\Lib\site-packages\openvino\cmake OR export OpenVINO_DIR=whisper_venv/lib/python3.10/site-packages/openvino/cmake/
pip install .[dev]

Copy link

review-notebook-app bot commented Sep 25, 2024

View / edit / reply to this conversation on ReviewNB

eaidova commented on 2024-09-25T15:29:13Z
----------------------------------------------------------------

I'm not sure that restriction for torch version is still actual. we set it due to torch 2.4 windows issue in optimum inference pipeline, for genai it is not actual.


Copy link

review-notebook-app bot commented Sep 25, 2024

View / edit / reply to this conversation on ReviewNB

eaidova commented on 2024-09-25T15:29:13Z
----------------------------------------------------------------

please add check that file already downloaded


sbalandi commented on 2024-09-26T22:43:15Z
----------------------------------------------------------------

done

Copy link

review-notebook-app bot commented Sep 25, 2024

View / edit / reply to this conversation on ReviewNB

eaidova commented on 2024-09-25T15:29:14Z
----------------------------------------------------------------

I think it makes sence to demonstrate data reading without hf datasets too (it is not obvious how to prepare input data for this case)


Copy link

review-notebook-app bot commented Sep 25, 2024

View / edit / reply to this conversation on ReviewNB

eaidova commented on 2024-09-25T15:29:15Z
----------------------------------------------------------------

Line #5.    

can we disable warning or somehow preformat output? it is hard to understated where warning text finished and answer started


sbalandi commented on 2024-09-26T22:58:09Z
----------------------------------------------------------------

fixed

Copy link

review-notebook-app bot commented Sep 25, 2024

View / edit / reply to this conversation on ReviewNB

eaidova commented on 2024-09-25T15:29:16Z
----------------------------------------------------------------

I'm not sure that weight compression makes sense for whisper. it has benefit for LLMs as they have large weights stored in matmul weights, even whisper large has less then 1b parameters. Please check optimum-based notebook to see suggested quantization approach


Copy link

review-notebook-app bot commented Sep 25, 2024

View / edit / reply to this conversation on ReviewNB

eaidova commented on 2024-09-25T15:29:17Z
----------------------------------------------------------------

Line #3.    device = device_widget(default="CPU", exclude=["AUTO", "GPU"])

is GPU really not supported?


sbalandi commented on 2024-09-26T22:44:12Z
----------------------------------------------------------------

remove excluding

eaidova commented on 2024-09-30T16:32:20Z
----------------------------------------------------------------

I belive for now we still need device excluding for NPU (until static pipeline for NPU will not be added in GenAI)

sbalandi commented on 2024-09-30T19:14:16Z
----------------------------------------------------------------

added

Copy link

review-notebook-app bot commented Sep 25, 2024

View / edit / reply to this conversation on ReviewNB

eaidova commented on 2024-09-25T15:29:17Z
----------------------------------------------------------------

Line #2.    import gradio as gr

I think the goal of gradio helper to hide all gradio demo necessary logic, maybe better to move it into gradio_helper?


)
gr.Markdown("## Examples")
gr.Examples(
[[str(audio_example_path), "<|en|>"]],
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest using an example with non-English source audio, otherwise translation task has no sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

Copy link

review-notebook-app bot commented Sep 25, 2024

View / edit / reply to this conversation on ReviewNB

aleksandr-mokrov commented on 2024-09-25T16:34:27Z
----------------------------------------------------------------

For better clarity, it should be added that the translation will be into English and you can specify the source language


Copy link
Contributor Author

done


View entire conversation on ReviewNB

Copy link
Contributor Author

remove excluding


View entire conversation on ReviewNB

@sbalandi
Copy link
Contributor Author

View / edit / reply to this conversation on ReviewNB

eaidova commented on 2024-09-25T15:29:14Z ----------------------------------------------------------------

I think it makes sence to demonstrate data reading without hf datasets too (it is not obvious how to prepare input data for this case)

changed to reading wav file

Copy link
Contributor Author

fixed


View entire conversation on ReviewNB

@sbalandi sbalandi closed this Sep 26, 2024
@sbalandi sbalandi reopened this Sep 26, 2024
Copy link

review-notebook-app bot commented Sep 30, 2024

View / edit / reply to this conversation on ReviewNB

as-suvorov commented on 2024-09-30T10:57:05Z
----------------------------------------------------------------

Should we provide meaningful data in the output instead of exception?


eaidova commented on 2024-09-30T16:34:46Z
----------------------------------------------------------------

as you have significant accuracy drop related to small models, I think maybe better to not demonstrate accuracy validation (possibly it can be improved changing smooth_quant_alpha parameter for quantization)

sbalandi commented on 2024-09-30T19:16:46Z
----------------------------------------------------------------

changed mooth_quant_alpha to 0.80 for encoder, thank you !

Copy link

review-notebook-app bot commented Sep 30, 2024

View / edit / reply to this conversation on ReviewNB

as-suvorov commented on 2024-09-30T10:57:06Z
----------------------------------------------------------------

Debug print?


notebooks/whisper-asr-genai/gradio_helper.py Show resolved Hide resolved
- '3.8'
- '3.9'
- os:
- macos-12
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't work on mac?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it works, removed, thank you !

@sbalandi sbalandi force-pushed the whisper branch 5 times, most recently from 3b5ddad to bb5604b Compare September 30, 2024 16:09
Copy link
Collaborator

eaidova commented Sep 30, 2024

I belive for now we still need device excluding for NPU (until static pipeline for NPU will not be added in GenAI)


View entire conversation on ReviewNB

Copy link
Collaborator

eaidova commented Sep 30, 2024

as you have significant accuracy drop related to small models, I think maybe better to not demonstrate accuracy validation (possibly it can be improved changing smooth_quant_alpha parameter for quantization)


View entire conversation on ReviewNB

Copy link

review-notebook-app bot commented Sep 30, 2024

View / edit / reply to this conversation on ReviewNB

eaidova commented on 2024-09-30T16:35:00Z
----------------------------------------------------------------

Line #3.    %pip install --pre -U openvino openvino-tokenizers openvino-genai --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly

-q missed in this linke


sbalandi commented on 2024-09-30T19:14:05Z
----------------------------------------------------------------

added

@sbalandi sbalandi force-pushed the whisper branch 2 times, most recently from 52ace1d to ab12094 Compare September 30, 2024 19:13
Copy link
Contributor Author

added


View entire conversation on ReviewNB

Copy link
Contributor Author

added


View entire conversation on ReviewNB

Copy link
Contributor Author

changed mooth_quant_alpha to 0.80 for encoder, thank you !


View entire conversation on ReviewNB

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.

4 participants