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

Standard functions with progress bars for downloads #303

Open
aaronchantrill opened this issue Nov 7, 2020 · 0 comments
Open

Standard functions with progress bars for downloads #303

aaronchantrill opened this issue Nov 7, 2020 · 0 comments
Labels
Hacktoberfest Small or non-core issues that could be worked on by Hacktoberfest participants Priority: Low Status: Available

Comments

@aaronchantrill
Copy link
Contributor

Description

As we attempt to make Naomi easier for people to set up, we need to download large files more and more often. These include binary executables and neural network models, git source repositories and python libraries. Right now if we have to download a large file, the best we can do is say what we are doing and then leave the user waiting. It would be helpful to have some standard functions for downloading files and git repositories that would contain hooks that can be connected to progress bars in different front ends (basically either command line terminal or html right now, but should be able to support an application or theoretical audio interface in the future).

Expected Behavior

We should be able to call a couple of standard functions in app_utils for download_file(url, destination) or download_git(url, destination_dir).

Actual Behavior

When we write code to download a file or git repository off the internet, we have to write it each time. This leads to inconsistency and it's difficult to maintain.

Possible Fix

https://stackoverflow.com/questions/51045540/python-progress-bar-for-git-clone

Steps to Reproduce

Download the newest version of the Deepspeech plugin, then try setting Deepspeech as your active STT engine.

Context

It's nice to know, during a long download, that the download is proceeding and about how long you have until it finishes

aaronchantrill added a commit to aaronchantrill/Naomi that referenced this issue Nov 23, 2020
There were a couple of issues here. One was that if Naomi needed
to download the model, it reconstructed the URL without paying
attention to the architecture, so on the raspberry pi it still
downloaded the pbmm model instead of the tflite model. I also
seemed to be having some trouble downloading the binary correctly
and kept getting an error message about the file header being
malformed. I "borrowed" some code from stack overflow which seems
to work pretty well. I put this code into app_utils as a start to
working on Issue NaomiProject#303 - Standard functions with progress bars for
downloads. At least we don't have to reinvent the wheel every
time we need to download a binary file.
aaronchantrill added a commit that referenced this issue Nov 24, 2020
* Fixed deepspeech model download

There were a couple of issues here. One was that if Naomi needed
to download the model, it reconstructed the URL without paying
attention to the architecture, so on the raspberry pi it still
downloaded the pbmm model instead of the tflite model. I also
seemed to be having some trouble downloading the binary correctly
and kept getting an error message about the file header being
malformed. I "borrowed" some code from stack overflow which seems
to work pretty well. I put this code into app_utils as a start to
working on Issue #303 - Standard functions with progress bars for
downloads. At least we don't have to reinvent the wheel every
time we need to download a binary file.

* Cleaning up some debugging text
@aaronchantrill aaronchantrill added Hacktoberfest Small or non-core issues that could be worked on by Hacktoberfest participants Priority: Low Status: Available labels Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest Small or non-core issues that could be worked on by Hacktoberfest participants Priority: Low Status: Available
Projects
None yet
Development

No branches or pull requests

1 participant