Esempio n. 1
0
 def no_retry_4xx(e):
     if not isinstance(e, requests.HTTPError):
         return True
     if not(e.response.status_code >= 400 and e.response.status_code < 500):
         return True
     body = json.loads(e.response.content)
     raise UsageError(body['errors'][0]['message'])
Esempio n. 2
0
 def get_file_stream_api(self):
     """This creates a new file pusher thread.  Call start to initiate the thread that talks to W&B"""
     if not self._file_stream_api:
         if self._current_run_id is None:
             raise UsageError(
                 'Must have a current run to use file stream API.')
         self._file_stream_api = FileStreamApi(self, self._current_run_id)
     return self._file_stream_api