facebookresearch / DrQA

Reading Wikipedia to Answer Open-Domain Questions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Runtime error while reading model from directory

daniildiveev opened this issue · comments

I've been trying to load model using

import drqa.reader
drqa.reader.set_default('model', '/content/DrQA/data/wikipedia/docs-tfidf-ngram=2-hash=16777216-tokenizer=simple.npz')
reader = drqa.reader.Predictor()

This is the output of the code above:

import drqa.reader
drqa.reader.set_default('model', '/content/DrQA/data/wikipedia/docs-tfidf-ngram=2-hash=16777216-tokenizer=simple.npz')
reader = drqa.reader.Predictor()

Here is the setup code:

!git clone https://github.com/facebookresearch/DrQA.git
%cd DrQA
!pip install -r requirements.txt
!python setup.py develop
!./download.sh

Tree of data dir (just like in the tutorial):

image

Sorry here is the error

---------------------------------------------------------------------------

RuntimeError                              Traceback (most recent call last)

<ipython-input-44-b3778f8cff3b> in <module>()
      1 import drqa.reader
      2 drqa.reader.set_default('model', '/content/DrQA/data/wikipedia/docs-tfidf-ngram=2-hash=16777216-tokenizer=simple.npz')
----> 3 reader = drqa.reader.Predictor()

3 frames

/usr/local/lib/python3.7/dist-packages/torch/serialization.py in __init__(self, name_or_buffer)
    240 class _open_zipfile_reader(_opener):
    241     def __init__(self, name_or_buffer) -> None:
--> 242         super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
    243 
    244 

RuntimeError: [enforce fail at inline_container.cc:114] . file in archive is not in a subdirectory: data.npy