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

Support for model downloader UI #871

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

a-prototype
Copy link

@nshmyrev Added the VOSK model downloader for vosk-api!

It scraps for models on https://alphacephei.com/vosk/models, it lists them, it downloads them, unzip and delete the zip file..
It does everything :)

We need to find a better location than the added folder...

Added the VOSK model downloader for vosk-api!
It scraps for models on https://alphacephei.com/vosk/models, it lists them, it downloads them, unzip and delete the zip file..
It does everything :)

We need to find a better location than the added folder...
@nshmyrev
Copy link
Collaborator

Hi. Thank you for your contribution!

Actually there is no need to scrape page, we have https://alphacephei.com/vosk/models/model-list.json which contains information about models in machine-readable format.

We also prefer command line instead of UI, there is no much need for GUI I think.

@Vadim-cloud-star, take a look on this.

@a-prototype
Copy link
Author

Thank you! I didn't know about the json!
I spent some hours on making the scrapper but I will change it soon to load the data from the json :)
After our little talk on my first push on ros-vosk (alphacep/ros-vosk#1) we talked about that you wanted a model downloader, I suggested something like the nltk downloader and I understood that you said that something like would be okay and and that's how the GUI was created... (Actually it is my first gui on python) Well it works and especially for ros-vosk i have tested it many times..
Do you want me to make it on command line too?

@nshmyrev
Copy link
Collaborator

you said that something like would be okay and and that's how the GUI was created

Sorry for confusion. I never thought NLTK has a GUI

Do you want me to make it on command line too?

That would be nice if you have time / courage. @Vadim-cloud-star works on it as a part of transcriber patch, but he hasn't started yet I think.

@a-prototype
Copy link
Author

Actually this project took me some good few hours just to help you and everyone else with this I don't mind spending some more time.. Most of it is ready based on the GUI.
Do you mind to discuss here or via mail about the procedure / way you want the models to get downloaded via the terminal?
Have you by any chance opened the GUI?
It lists the languages, when you select a language it lists the models on a combo box and shows the info of the model..
You can also select another path etc.
vosk_downloader

@a-prototype
Copy link
Author

a-prototype commented Feb 24, 2022

On ros-vosk I solved it completely because I know where I want my model. (I pushed it directly alphacep/ros-vosk@aa4e6fe )
If you run the vosk_node.py (on ros-vosk) and the node will not find the folder or a model, it will automatically open the GUI, you download the required model and the node continues without any action from the user!
The download, unzip of the model, deletion of the zip and the loading of the downloaded model's name to Model obj of vosk happens automatically.
I shall make it also like this for vosk-api if you don't mind re arranging the folders and scripts.

@nshmyrev
Copy link
Collaborator

Ok, great. Lets have a GUI then. We will probably need a list of installed model and a way to uninstall too. Like in NLTK (I just checked the screenshot). Lets keep it open, we will work on it too, hopefully next week.

@a-prototype
Copy link
Author

I will happily work on it too.
For ROS it's easy to check for the models..
For vosk-api can we please discuss the proper way?

@nshmyrev
Copy link
Collaborator

For vosk-api can we please discuss the proper way?

Sure, I'd be happy to catch you when you are available. On any messenger or meeting.

@a-prototype
Copy link
Author

Of course!
I am sending you an email to arrange this

nshmyrev pushed a commit that referenced this pull request May 24, 2022
* methods get_model_by_name, get_model_by_lang, get_model were added into the model class

* importing modules changed to using components; introduced constant MODELS_HOME_DIR; simplified code

* added new model folders into init; changed samples and transcriber bin for new mode loader

* changed back in cli.py lang arg to args.lang

* added 3 directories instead of 1 to check for models

* cli.py: added 3 args instead of 1 for model; __init__.py: changed script get_model_path for run get_model_by_name/lang inside current directory

* deleted default env var

* cli.py: changed arg_name; __init__.py: changed const name, changed model loading only for last directory

* deleted unused method

* changed by_name, by_lang methods, added download_model method

* deleted env variable initialization

* deleted print()

* deteled unused modules

* added progress_bar, added folder AppData/Local/vosk for model search

* changed download_model methond; added my_hook method
@nshmyrev
Copy link
Collaborator

Hi! We have merged the command line code to download model automatically. We could have UI too, so I'm renaming the issue.

@nshmyrev nshmyrev changed the title Added the VOSK Model downloader Support for model downloader UI May 24, 2022
@nalbion
Copy link
Contributor

nalbion commented Dec 17, 2022

@nshmyrev could you please indicate in https://alphacephei.com/vosk/models/model-list.json whether or not each model supports grammars (lookahead/precompiled HCLG graph)?

@nshmyrev
Copy link
Collaborator

@nalbion you can check "type" field. "small" and "big-lgraph" support grammar, "big" doesn't

@nalbion
Copy link
Contributor

nalbion commented Dec 18, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants