I am trying to run your web app and I keep getting errors. As I couldn't figure it out by myself I decided to ask you.
I have downloaded the pretrained models and set their path. And I got a error of toxic_model.pth file is missing under fine_tuned folder.
FileNotFoundError: [Errno 2] No such file or directory: 'machine_learning/model_hub/fine_tuned/toxic_model.pth'
I tried adding a blank file with toxic_model.pth but it still gives this error.
EOFError: Ran out of input
I am attaching both errors.
(venv) PS D:\DeTox-main\DeTox-main\app> uvicorn main:app --reload
INFO: Will watch for changes in these directories: ['D:\\DeTox-main\\DeTox-main\\app']
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process [8104] using StatReload
File "D:\DeTox-main\venv\lib\site-packages\starlette\routing.py", line 530, in __aenter__
await self._router.startup()
File "D:\DeTox-main\venv\lib\site-packages\starlette\routing.py", line 614, in startup
handler()
File "D:\DeTox-main\DeTox-main\app\.\main.py", line 30, in startup_event
load_model()
File "D:\DeTox-main\DeTox-main\app\.\machine_learning\make_predictions.py", line 23, in load_model
model.load_state_dict(torch.load(fine_tuned_path, map_location=device))
File "D:\DeTox-main\venv\lib\site-packages\torch\serialization.py", line 791, in load
with _open_file_like(f, 'rb') as opened_file:
File "D:\DeTox-main\venv\lib\site-packages\torch\serialization.py", line 271, in _open_file_like
return _open_file(name_or_buffer, mode)
File "D:\DeTox-main\venv\lib\site-packages\torch\serialization.py", line 252, in __init__
super().__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'machine_learning/model_hub/fine_tuned/toxic_model.pth'
ERROR: Application startup failed. Exiting.
(venv) PS D:\DeTox-main\DeTox-main\app> uvicorn main:app --reload
INFO: Will watch for changes in these directories: ['D:\\DeTox-main\\DeTox-main\\app']
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process [12256] using StatReload
INFO: Started server process [15368]
INFO: Waiting for application startup.
ERROR: Traceback (most recent call last):
File "D:\DeTox-main\venv\lib\site-packages\starlette\routing.py", line 635, in lifespan
async with self.lifespan_context(app):
File "D:\DeTox-main\venv\lib\site-packages\starlette\routing.py", line 530, in __aenter__
await self._router.startup()
File "D:\DeTox-main\venv\lib\site-packages\starlette\routing.py", line 614, in startup
handler()
File "D:\DeTox-main\DeTox-main\app\.\main.py", line 30, in startup_event
load_model()
File "D:\DeTox-main\DeTox-main\app\.\machine_learning\make_predictions.py", line 23, in load_model
model.load_state_dict(torch.load(fine_tuned_path, map_location=device))
File "D:\DeTox-main\venv\lib\site-packages\torch\serialization.py", line 815, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "D:\DeTox-main\venv\lib\site-packages\torch\serialization.py", line 1033, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
EOFError: Ran out of input
ERROR: Application startup failed. Exiting.