Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need Help Running Basic QA Notebook on Windows 10 #1445

Closed
windowshopr opened this issue Sep 13, 2021 · 12 comments · Fixed by #1458
Closed

Need Help Running Basic QA Notebook on Windows 10 #1445

windowshopr opened this issue Sep 13, 2021 · 12 comments · Fixed by #1458

Comments

@windowshopr
Copy link

image

Ideas? I'm running the Docker Desktop engine already...

@julian-risch
Copy link
Member

Hi @windowshopr I found a post about this error message here. Based on that, could you please try the following by making some changes to the code:

es_server = Popen(['elasticsearch-7.9.2/bin/elasticsearch'],
                       stdout=PIPE, stderr=STDOUT
                      )

I wonder why we have not seen this error before. 🤔

@windowshopr
Copy link
Author

Thanks @julian-risch , I've made that change, but now I see another error:

image

I imagine this has something to do with Popen not "finding" the directory I've provided, but I've tried a few combinations of directory path strings, like "C:\\elasticsearch-7.14.1\\bin\\elasticsearch", ''C:\elasticsearch-7.14.1\bin\elasticsearch'', r"C:\elasticsearch-7.14.1\bin\elasticsearch", and still same error. That IS the file path to my elasticsearch folder, so not sure why it's not finding it? Another Windows issue?

@julian-risch
Copy link
Member

I am not sure either. Could it be that there is a .exe or .bat file to start ES on Windows? I saw this very old post here: https://stackoverflow.com/questions/38178099/run-elasticsearch-using-python Don't know whether that's outdated.
I would put more trust in the ES documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/windows.html#msi-installer-command-line-configuration

@windowshopr
Copy link
Author

I added ".bat" to the end so it works now, but now, another error. I'm hoping this thread will act as a guide for other Windows users.

Here's what I'm seeing now:

image

Usually this error happens on Windows if 1) you literally don't have permissions to that file, or 2) the file is being used by another program at the same time. Is there a solution already for this? Thanks!

@lalitpagaria
Copy link
Contributor

@windowshopr Check if this solve your issue.
#709 (comment)

@windowshopr
Copy link
Author

@lalitpagaria Thanks, that worked! I sub'd this line:

fetch_archive_from_http(url=s3_url, output_dir=doc_dir)

for

import requests
import zipfile
import io
r = requests.get(s3_url)
z = zipfile.ZipFile(io.BytesIO(r.content))
z.extractall(doc_dir)

Will continue on and post any other hiccups I come across, and the changes I make. Else, I'll close the issue if I make it through.

@windowshopr
Copy link
Author

Here's another issue:

image

Looking at the ExtractiveQAPipeline class, it doesn't accept params as a parameter:

class ExtractiveQAPipeline(BaseStandardPipeline):
    def __init__(self, reader: BaseReader, retriever: BaseRetriever):
        """
        Initialize a Pipeline for Extractive Question Answering.

        :param reader: Reader instance
        :param retriever: Retriever instance
        """
        self.pipeline = Pipeline()
        self.pipeline.add_node(component=retriever, name="Retriever", inputs=["Query"])
        self.pipeline.add_node(component=reader, name="Reader", inputs=["Retriever"])

    def run(self, query: str, filters: Optional[Dict] = None, top_k_retriever: int = 10, top_k_reader: int = 10):
        output = self.pipeline.run(
            query=query, filters=filters, top_k_retriever=top_k_retriever, top_k_reader=top_k_reader
        )
        return output

So what should the line be to run the pipe.run command?

@lalitpagaria
Copy link
Contributor

@windowshopr It seems you don't have latest change, try pulling latest changes and check it out. @oryx1729 recently updated pipeline signature in this PR #1321. Please refer new signature https://github.com/deepset-ai/haystack/blob/master/haystack/pipeline.py#L575

@windowshopr
Copy link
Author

Not sure I follow, I installed the entire package yesterday, using the command pip install farm-haystack -f https://download.pytorch.org/whl/torch_stable.html, so it should be the latest version, but if there's a change I need to pull, what commands should I run to do that?

@lalitpagaria
Copy link
Contributor

Try this to use latest changes (before that you might need to uninstall existing version) -

pip install git+git://github.com/deepset-ai/haystack@master#egg=farm-haystack -f https://download.pytorch.org/whl/torch_stable.html

@julian-risch
Copy link
Member

@windowshopr Lalit is referring to the changes that have been made here: 9dd7c74

@windowshopr
Copy link
Author

Thanks all, I did an uninstall, and re-install using that command and she works! Takes a while to get an answer, but I can play with it from here. Thanks for your help, and hopefully this helps some future users!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants