Skip to content

Commit

Permalink
making retries slower and nameres timeout longer
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDietzMorris committed Jul 18, 2024
1 parent 0c0aa5e commit 83fa6c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion parsers/LitCoin/src/NER/nameres.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def annotate(self, text, props, limit=1):
if props.get('skip_umls', False):
skip_umls = True

timeout = props.get('timeout', 10) # Default to 10 seconds
timeout = props.get('timeout', 15) # Default to 10 seconds

# Make a request to Nemo-Serve.
nameres_options = {
Expand Down
6 changes: 3 additions & 3 deletions parsers/LitCoin/src/bagel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

# output of parse_gpt looks like {"entity": triple["object"], "qualifier": triple["object_qualifier"]}
session = requests.Session()
retries = Retry(total=5,
backoff_factor=0.1,
status_forcelist=[502, 503, 504, 429])
retries = Retry(total=8,
backoff_factor=.75,
status_forcelist=[502, 503, 504, 520, 429])
session.mount('http://', HTTPAdapter(max_retries=retries))
session.mount('https://', HTTPAdapter(max_retries=retries))
nameres = NameResNEREngine(session)
Expand Down
6 changes: 3 additions & 3 deletions parsers/LitCoin/src/predicate_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def __init__(self, logger, workspace_dir='./workspace'):
self.workspace_dir = workspace_dir

session = requests.Session()
retries = Retry(total=5,
backoff_factor=0.1,
status_forcelist=[502, 503, 504, 429])
retries = Retry(total=8,
backoff_factor=.75,
status_forcelist=[502, 503, 504, 520, 429])
session.mount('http://', HTTPAdapter(max_retries=retries))
session.mount('https://', HTTPAdapter(max_retries=retries))
self.requests_session = session
Expand Down

0 comments on commit 83fa6c6

Please sign in to comment.