Skip to content

Commit c71bf3f

Browse files
committed
Need to ensure that the server is alive when using scenegraph. Otherwise, a request attempt might happen while the server is still loading and therefore fail. See discussion at stanfordnlp/CoreNLP#1346
1 parent b63fdfe commit c71bf3f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stanza/server/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,11 @@ def scenegraph(self, text, properties=None):
699699
700700
This will require a new CoreNLP release, 4.5.5 or later
701701
"""
702+
# since we're using requests ourself,
703+
# check if the server has started or not
704+
if self.start_server is not StartServer.DONT_START:
705+
self.ensure_alive()
706+
702707
if properties is None:
703708
properties = {}
704709
# the only thing the scenegraph knows how to use is text

0 commit comments

Comments
 (0)