mirror of
https://github.com/marian-nmt/marian.git
synced 2024-11-30 21:39:52 +03:00
minor rename
This commit is contained in:
parent
fc3dfcfea2
commit
c8249482a7
@ -23,7 +23,7 @@ int main(int argc, char* argv[]) {
|
||||
std::setvbuf(stdin, NULL, _IONBF, 0);
|
||||
boost::timer::cpu_timer timer;
|
||||
|
||||
std::string in;
|
||||
std::string line;
|
||||
std::size_t lineNum = 0;
|
||||
|
||||
size_t miniSize = god.Get<size_t>("mini-batch");
|
||||
@ -33,8 +33,8 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
SentencesPtr maxiBatch(new Sentences());
|
||||
|
||||
while (std::getline(god.GetInputStream(), in)) {
|
||||
maxiBatch->push_back(SentencePtr(new Sentence(god, lineNum++, in)));
|
||||
while (std::getline(god.GetInputStream(), line)) {
|
||||
maxiBatch->push_back(SentencePtr(new Sentence(god, lineNum++, line)));
|
||||
|
||||
if (maxiBatch->size() >= maxiSize) {
|
||||
|
||||
|
@ -40,16 +40,14 @@ boost::python::list translate(boost::python::list& in)
|
||||
|
||||
boost::python::list output;
|
||||
for(int i = 0; i < boost::python::len(in); ++i) {
|
||||
std::string s = boost::python::extract<std::string>(boost::python::object(in[i]));
|
||||
std::string line = boost::python::extract<std::string>(boost::python::object(in[i]));
|
||||
results.emplace_back(
|
||||
god_.GetThreadPool().enqueue(
|
||||
[=]{ return TranslationTask(s, i); }
|
||||
[=]{ return TranslationTask(line, i); }
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
size_t lineCounter = 0;
|
||||
|
||||
for (auto&& result : results) {
|
||||
std::stringstream ss;
|
||||
Printer(god_, *result.get().get(), ss);
|
||||
|
Loading…
Reference in New Issue
Block a user