text
stringlengths
0
2.2M
dm.createServiceManager<LoggerAdmin<LOGGER_TYPE>, ILoggerAdmin>();
dm.createServiceManager<SerializationAdmin, ISerializationAdmin>();
dm.createServiceManager<TestMsgJsonSerializer, ISerializer>();
dm.createServiceManager<HttpContextService, IHttpContextService>();
dm.createServiceManager<WsHostService, IHostService>(Properties{{"Address", Ichor::make_any<std::string>("127.0.0.1")}, {"Port", Ichor::make_any<uint16_t>(8001)}});
dm.createServiceManager<ClientAdmin<WsConnectionService>, IClientAdmin>();
dm.createServiceManager<UsingWsService>(Properties{{"Address", Ichor::make_any<std::string>("127.0.0.1")}, {"Port", Ichor::make_any<uint16_t>(8001)}});
dm.start();
auto end = std::chrono::steady_clock::now();
fmt::print("Program ran for {:L} s\n", std::chrono::duration_cast<std::chrono::microseconds>(end-start).count());
return 0;
}
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <cstdlib>
#include <fstream>
#include <functional>
#include <random>
#include <string>
#include <vector>
#include <cereal/archives/json.hpp>
#include <cereal/types/unordered_map.hpp>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include "flashlight/pkg/speech/augmentation/SoundEffectConfig.h"
#include "flashlight/pkg/speech/common/Defines.h"
#include "flashlight/pkg/speech/criterion/criterion.h"
#include "flashlight/pkg/speech/data/FeatureTransforms.h"
#include "flashlight/pkg/speech/data/Utils.h"
#include "flashlight/pkg/speech/decoder/TranscriptionUtils.h"
#include "flashlight/pkg/speech/runtime/runtime.h"
#include "flashlight/pkg/runtime/common/DistributedUtils.h"
#include "flashlight/pkg/runtime/common/SequentialBuilder.h"
#include "flashlight/pkg/runtime/common/Serializer.h"
#include "flashlight/pkg/runtime/Runtime.h"
#include "flashlight/pkg/runtime/plugin/ModulePlugin.h"
#include "flashlight/fl/contrib/contrib.h"
#include "flashlight/fl/flashlight.h"
#include "flashlight/lib/common/System.h"
#include "flashlight/lib/text/dictionary/Dictionary.h"
#include "flashlight/lib/text/dictionary/Utils.h"
using fl::pkg::runtime::Serializer;
using fl::pkg::runtime::afToVector;
using fl::pkg::runtime::getRunFile;
using fl::lib::fileExists;
using fl::lib::format;
using fl::lib::getCurrentDate;
using fl::lib::join;
using fl::lib::pathsConcat;
using namespace fl::pkg::speech;
int main(int argc, char** argv) {
google::InitGoogleLogging(argv[0]);
google::InstallFailureSignalHandler();
std::string exec(argv[0]);
std::vector<std::string> argvs;
for (int i = 0; i < argc; i++) {
argvs.emplace_back(argv[i]);
}
gflags::SetUsageMessage("Usage: \n " + exec + " [model] [flags]");
fl::init();
/* ===================== Parse Options ===================== */
int runIdx = 1; // current #runs in this path
std::string reloadPath = argv[1]; // path to model to reload
std::unordered_map<std::string, std::string> cfg;
int64_t startEpoch = 0;
int64_t startUpdate = 0;
if (argc <= 1) {
LOG(FATAL) << gflags::ProgramUsage();
}
std::string version;
Serializer::load(reloadPath, version, cfg);
auto flags = cfg.find(kGflags);
if (flags == cfg.end()) {
LOG(FATAL) << "Invalid config loaded from " << reloadPath;
}
LOG(INFO) << "Reading flags from config file " << reloadPath;
gflags::ReadFlagsFromString(flags->second, gflags::GetArgv0(), true);
if (argc > 3) {
LOG(INFO) << "Parsing command line flags";
gflags::ParseCommandLineFlags(&argc, &argv, false);
}
if (!FLAGS_flagsfile.empty()) {
LOG(INFO) << "Reading flags from file" << FLAGS_flagsfile;