Downloading a file from a URL


Import required packages

[2]:
from oceanai.modules.lab.build import Run

Build

[3]:
_b5 = Run(
    lang = 'en', # Interface language
    color_simple = '#333', # Plain text color (hexadecimal code)
    color_info = '#1776D2', # The color of the text containing the information (hexadecimal code)
    color_err = '#FF0000', # Error text color (hexadecimal code)
    color_true = '#008001', # Text color containing positive information (hexadecimal code)
    bold_text = True, # Bold text
    num_to_df_display = 30, # Number of rows to display in tables
    text_runtime = 'Runtime', # Runtime text
    metadata = True # Displaying information about library
)

[2024-10-08 19:48:12] OCEANAI - персональные качества личности человека:    Авторы:        Рюмина Елена [ryumina_ev@mail.ru]        Рюмин Дмитрий [dl_03.03.1991@mail.ru]        Карпов Алексей [karpov@iias.spb.su]    Сопровождающие:        Рюмина Елена [ryumina_ev@mail.ru]        Рюмин Дмитрий [dl_03.03.1991@mail.ru]    Версия: 1.0.0a40    Лицензия: BSD License

Download process

[4]:
# Настройки ядра
_b5.path_to_save_ = './models' # Директория для сохранения файла
_b5.chunk_size_ = 2000000 # Размер загрузки файла из сети за 1 шаг

res_download_file_from_url = _b5.download_file_from_url(
    url = 'https://drive.usercontent.google.com/download?id=1dyH4lqajNS7LOwNqcfj3YktxlJrbLSXf&export=download&authuser=2&confirm=t&uuid=f69981d0-9852-4e0e-8d49-91b55dae3da0&at=AN_67v1nGyJJ427XWPLc3ISlZxbx:1727456802847',
    force_reload = True,
    out = True,
    runtime = True,
    run = True
)

[2024-10-08 19:48:15] Загрузка файла “weights_2023-07-16_18-12-01.pth” 100.0% …

— Время выполнения: 2.362 сек. —

[5]:
res_download_file_from_url
[5]:
200