You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running pipe.eval with add_isolated_node_eval=True, an UnboundLocalError occurs.
Error message
UnboundLocalError: local variable 'predict' referenced before assignment. In haystack/nodes/reader/base.py at line 95.
Expected behavior
I assume the reader should take the input from the context given in the label for isolated evaluation.
Additional context
The error only occurs when evaluating on documents other than the ones from the eval labels (open-domain QA setting) and adding filters to the labels such that there are no documents in the document store that are matching the filter.
System:
OS:
GPU/CPU: CPU
Haystack version (commit or version number): 1.2.0
DocumentStore: Elasticsearch
Reader: FARMReader
Retriever: ElasticsearchRetriever (bm25)
Possible Solution (?)
I'm not quite sure what causes the error, but adding
predict = self.timing(self.predict, "query_time")
to haystack/nodes/reader/base.py line 94 seems to solve the error.
The text was updated successfully, but these errors were encountered:
Hey @thimo72,
thanks for reaching out. Yes, the predict assignment should have happened before the if block in line 81.
In your case the retriever seems not to return any documents, thus choosing the else block (line 84) and predict remains unknown. Later on in add_isolated_node_eval the call of predict fails.
The cleanest solution would be to move the predict assignment from line 82 to line 81 (before the if block). Would you like to contribute this fix in a PR? Otherwise I'll fix it. Just let me know, so we make it work as intended quickly.
Describe the bug
When running pipe.eval with add_isolated_node_eval=True, an UnboundLocalError occurs.
Error message
UnboundLocalError: local variable 'predict' referenced before assignment. In haystack/nodes/reader/base.py at line 95.
Expected behavior
I assume the reader should take the input from the context given in the label for isolated evaluation.
Additional context
The error only occurs when evaluating on documents other than the ones from the eval labels (open-domain QA setting) and adding filters to the labels such that there are no documents in the document store that are matching the filter.
System:
Possible Solution (?)
I'm not quite sure what causes the error, but adding
predict = self.timing(self.predict, "query_time")
to haystack/nodes/reader/base.py line 94 seems to solve the error.
The text was updated successfully, but these errors were encountered: