Example #1
0
 def on_start(self):
     self._model_client = ModelClient('recognize_digits',
                                      '1.0',
                                      token=build_client().get_token(
                                          'recognize_digits', '1.0'),
                                      use_relative_url=True,
                                      http_client=self.client)
Example #2
0
 def on_start(self):
     self._model_client = ModelClient('movie-lens',
                                      '1.0',
                                      use_relative_url=True,
                                      http_client=self.client,
                                      token=build_client().get_token(
                                          'movie-lens', '1.0'))
Example #3
0
def generate_token(args):
    """
    Generate JWT for specified model
    :param args: command arguments
    :type args: argparse.Namespace
    :return: str -- token
    """
    edi_client = edi.build_client(args)
    token = edi_client.get_token(args.model_id, args.model_version,
                                 args.expiration_date)
    print(token)
Example #4
0
def _check_credentials(args):
    """
    Make a request to the server to make sure that credentials are correct

    :param args: command arguments with .namespace
    :type args: argparse.Namespace
    :return None
    """
    # url and token must presents in args
    edi_clint = edi.build_client(args)

    edi_clint.info()
Example #5
0
 def on_start(self):
     self._model_client = ModelClient('test_summation', '1.0', use_relative_url=True,
                                      http_client=self.client,
                                      token=build_client().get_token('test_summation', '1.0'))
Example #6
0
 def setUp(self):
     self._client = ModelClient(os.environ.get(*legion.config.MODEL_ID),
                                '1.0',
                                token=build_client().get_token(
                                    os.environ.get(*legion.config.MODEL_ID),
                                    '1.0'))