-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Download session headers #1429
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
мне ок, как я понял чисто ради поддержки версионирования добавили хедерс.
headers = { | ||
'dp-token': get_download_token(), | ||
'dp-session': session_id, | ||
'dp-file-id': str(last_id - file_id), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last_id - file_id
вау а что это за математика?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В рамках одной сессии скачивания моделей мы имеей N файлов. last_id-file_id нужно чтобы нумеровать эти файлы от N-1 до 0. Получив dp-file-id == 0 мы понимаем, что это был последний файл в рамках данной сессии. С тем же успехом можно было добавить какой-нибудь хэдер вроде dp-last-session-file для последнего файла, но сделал обратный отсчёт.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ок, но я бы вынес в отдельную переменную, а то с ума сойдём потом
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Т.е. добавить dp_file_id = last_id - file_id
, а в дикте 'dp-file-id': str(dp_file_id)
? Не вижу смысла. Или ты про другую отдельную переменную?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
смысл был только в том, чтобы было понятное название у этой разности, но и так нормас
но ответь плиз на комменты |
* feat: some changes to provide more precise statistics * feat: update headers for proper stats
No description provided.