def start_kbs_server(): """Starts a local KBS server and returns its handler.""" # Starts a local KBS server. options = kbs_server_helper.KnowledgeBankServiceOptions(True, -1, 10) server = kbs_server_helper.KbsServerHelper(options) FLAGS.kbs_address = "localhost:%d" % server.port() return server
def start_kbs_server(): """Starts a local KBS server and returns its handler.""" # Starts a local KBS server. options = kbs_server_helper.KnowledgeBankServiceOptions(True, -1, 10) server = kbs_server_helper.KbsServerHelper(options) # Placeholder for setting --kbs_address. return server
def main(argv): del argv # Starts a local KBS server. options = kbs_server_helper.KnowledgeBankServiceOptions(True, -1, 10) kbs_server = kbs_server_helper.KbsServerHelper(options) kbs_address = 'localhost:%d' % kbs_server.port() train_model(kbs_address)
def testKbsServerHelper(self): options = kbs_server_helper.KnowledgeBankServiceOptions(True, -1, 10) server = kbs_server_helper.KbsServerHelper(options) self.assertNotEqual('', server.address()) server.Terminate()
def testKnowledgeBankServiceOptions(self): options = kbs_server_helper.KnowledgeBankServiceOptions(True, 200, 10) self.assertTrue(options.run_locally) self.assertEqual(200, options.port) self.assertEqual(10, options.num_threads)
def start_server(): options = kbs_server_helper.KnowledgeBankServiceOptions(True, -1, 10) server = kbs_server_helper.KbsServerHelper(options) kbs_address = 'localhost:%d' % server.port() return server, kbs_address