facebookresearch / facebookresearch/HalluLens
Problem in HalluLens/data/wiki_data/make_title_db.py, line 27
- Dominant language
- Python
- Stars
- 84
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I'm having a problem with HalluLens/data/wiki_data/make_title_db.py, line 27:
db = DocDB(db_path=db_path)
This call to DocDB requires data_path to be not None.
assert data_path is not None, f"{self.db_path} is empty. Specify `data_path` in order to create a DB."
I tried this:
db_path=args.wiki_db_path
db_title_path=db_path.replace(".db", "-title.db")
print("db_path = %s" % db_path)
# db = DocDB(db_path=db_path) # throws assert, need data_path to be set
db = DocDB(db_path=db_path, data_path = db_title_path) # try this?
which does get past the assert and downloads some files, but it then subsequently fails with this message:
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/lloyd/HalluLens/data/wiki_data/make_title_db.py", line 29, in
db = DocDB(db_path=db_path, data_path = db_title_path) # try this?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lloyd/HalluLens/tasks/longwiki/retrieval.py", line 44, in __init__
self.build_db(self.db_path, data_path)
File "/home/lloyd/HalluLens/tasks/longwiki/retrieval.py", line 71, in build_db
with open(data_path, "r") as f:
^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'data/wiki_data/.cache/enwiki-20230401-title.db'
So my quick attempted fix is not working right. Do you know how to fix this problem?
Thank you,
Lloyd
Contributor guide
Research direction
Start with data/wiki_data/make_title_db.py around line 27, then read DocDB.__init__ and build_db in tasks/longwiki/retrieval.py to trace the expected data_path and database path. The attempted title database path is missing, so verify the required input path and make_title_db's setup. Done means the script runs without the assertion or FileNotFoundError and creates the title database.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100