Pretrained model requires `assets` folder creation
Querela opened this issue · comments
bin/download_model
Downloading...
From: https://drive.google.com/uc?id=1V8itWtowCYnb2Bc9KlK9SxGff9WwmogA
To: /home/koerner/work/test/Deploy-BERT-for-Sentiment-Analysis-with-FastAPI/assets/model_state_dict.bin
Traceback (most recent call last):
File "./bin/download_model", line 4, in <module>
gdown.download(
File "/home/koerner/work/test/Deploy-BERT-for-Sentiment-Analysis-with-FastAPI/venv/lib/python3.8/site-packages/gdown/download.py", line 153, in download
f = open(tmp_file, "wb")
FileNotFoundError: [Errno 2] No such file or directory: 'assets/model_state_dict.bin09kxowvvtmp'
Solution, add this to the script, to just create the folder if it does not exist:
from pathlib import Path
Path("assets").mkdir(exist_ok=True)