ko-nlp / Korpora

Korean corpus repository
Creative Commons Attribution 4.0 International
693 stars 80 forks source link

데이터 다운로드 도중 취소한 케이스 대응 #90

Closed hungry-wook closed 4 years ago

hungry-wook commented 4 years ago

데이터 다운로드 도중에 취소한 경우, 해당 파일을 처음부터 새로 받는것이 아니라 그 다음 파일 다운로드로 넘어갑니다. 파일 용량 기준으로 기다운로드 여부를 체크하여야 할것 같습니다.

lovit commented 4 years ago

@hungry-wook 커멘트 감사합니다.

해당 기능을 다음 버전 배포시 구현할 예정입니다. 지금은 다음처럼 강제로 오버라이딩 할 수 있습니다.

from Korpora import Korpora

Korpora.fetch(CORPUS_NAME, force_download=True)
lovit commented 4 years ago

url 과 local 에서 파일 크기를 확인하는 예제코드를 기록해 둡니다.

from urllib import request

url = 'https://github.com/Beomi/KcBERT/releases/download/TrainData_v1/kcbert-train.tar.gzab'
site = request.urlopen(url)
meta = site.info()
meta['Content-Length']  # '2097152000'

import os

os.stat('~/Korpora/kcbert/kcbert-train.tar.gzab').st_size  # 2097152000