Skip to content

Commit

Permalink
feat: ✨ add an headless option for model downloads
Browse files Browse the repository at this point in the history
This should help with #9, i.e Google Colab mode
  • Loading branch information
melMass committed Jul 5, 2023
1 parent f8dc768 commit 217e8a1
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/download_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def handle_interrupt():
console.print("Interrupted by user.", style="bold red")


def main(models_to_download):
def main(models_to_download, skip_input=False):
try:
models_to_download_selected = {}

Expand Down Expand Up @@ -129,8 +129,10 @@ def check_destination(urls, destination):
console.print("No new models to download.")
return

models_to_download_selected = ask_user_for_downloads(
models_to_download_selected
models_to_download_selected = (
ask_user_for_downloads(models_to_download_selected)
if not skip_input
else models_to_download_selected
)

for model_name, model_details in models_to_download_selected.items():
Expand All @@ -143,4 +145,10 @@ def check_destination(urls, destination):


if __name__ == "__main__":
main(models_to_download)
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("-y", "--yes", action="store_true", help="skip user input")

args = parser.parse_args()
main(models_to_download, args.yes)

0 comments on commit 217e8a1

Please sign in to comment.