Skip to content

Pretrained model requires assets folder creation #2

@Querela

Description

@Querela
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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions