Data decompression error
Hi! I followed the installation guide at README.md
.
As soon as I start the server, I encounter the following error.
~/crag-mock-api$ uvicorn server:app --reload
INFO: Will watch for changes in these directories: ['/home/crag-mock-api']
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO: Started reloader process [7873] using WatchFiles
INFO: Started server process [7875]
INFO: Waiting for application startup.
2024-04-14 16:03:02.570 | INFO | cragapi.open:__init__:24 - Reading open_kg file from: cragkg/open/kg.0.jsonl.bz2
ERROR: Traceback (most recent call last):
File "/home/work/.conda/envs/crag/lib/python3.10/site-packages/starlette/routing.py", line 677, in lifespan
async with self.lifespan_context(app) as maybe_state:
File "/home/work/.conda/envs/crag/lib/python3.10/contextlib.py", line 199, in __aenter__
return await anext(self.gen)
File "/home/crag-mock-api/server.py", line 25, in lifespan
API["open"] = OpenKG()
File "/home/crag-mock-api/cragapi/open.py", line 26, in __init__
l = f.readline()
File "/home/work/.conda/envs/crag/lib/python3.10/bz2.py", line 176, in read1
return self._buffer.read1(size)
File "/home/work/.conda/envs/crag/lib/python3.10/_compression.py", line 68, in readinto
data = self.read(len(byte_view))
File "/home/work/.conda/envs/crag/lib/python3.10/_compression.py", line 103, in read
data = self._decompressor.decompress(rawblock, size)
OSError: Invalid data stream
ERROR: Application startup failed. Exiting.
- Environment
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
- Python version: 3.10.4
- Conda version: 24.1.2
I guess the problem is somewhat related to the file format bz2
, but I lack expertise for this error.
Does anyone have a idea for solving this issue?