undertheseanlp / underthesea

Underthesea - Vietnamese NLP Toolkit
http://undertheseanlp.com
GNU General Public License v3.0
1.35k stars 270 forks source link

Permission error when trying to remove the downloaded model zip file #704

Closed BLKSerene closed 9 months ago

BLKSerene commented 11 months ago

When running on Windows CI with Python 3.11, a permission error is raised when trying to remove the downloaded model zip file after the model content is extracted.

The problem might be that the zip file is not closed properly before trying to delete the file. Maybe using with would be a better choice here.

rain1024 commented 11 months ago

@BLKSerene, it sounds correct. What is your environment (os, python version) and which specific commands did you use?

BLKSerene commented 11 months ago

The error occurred on CI with Windows Server 2019 and Python 3.11.4. I use the sentiment analysis function (underthesea.sentiment) which downloads the model automatically the first time the function is invoked