mirror of
https://github.com/marian-nmt/marian.git
synced 2024-11-03 20:13:47 +03:00
Add lexical shortlists to marian-server (#560)
* Add lexical shortlists to marian-server * Update CHANGELOG
This commit is contained in:
parent
734a8791dd
commit
c343ced9e1
@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- Support for lexical shortlists in marian-server
|
||||
- Support for 8-bit matrix multiplication with FBGEMM
|
||||
- CMakeLists.txt now looks for SSE 4.2
|
||||
- Purging of finished hypotheses during beam-search. A lot faster for large batches.
|
||||
|
@ -175,6 +175,7 @@ private:
|
||||
|
||||
std::vector<Ptr<Vocab>> srcVocabs_;
|
||||
Ptr<Vocab> trgVocab_;
|
||||
Ptr<const data::ShortlistGenerator> shortlistGenerator_;
|
||||
|
||||
size_t numDevices_;
|
||||
|
||||
@ -199,6 +200,11 @@ public:
|
||||
trgVocab_ = New<Vocab>(options_, vocabPaths.size() - 1);
|
||||
trgVocab_->load(vocabPaths.back());
|
||||
|
||||
// load lexical shortlist
|
||||
if(options_->hasAndNotEmpty("shortlist"))
|
||||
shortlistGenerator_ = New<data::LexicalShortlistGenerator>(
|
||||
options_, srcVocabs_.front(), trgVocab_, 0, 1, vocabPaths.front() == vocabPaths.back());
|
||||
|
||||
// get device IDs
|
||||
auto devices = Config::getDevices(options_);
|
||||
numDevices_ = devices.size();
|
||||
@ -218,8 +224,11 @@ public:
|
||||
graphs_.push_back(graph);
|
||||
|
||||
auto scorers = createScorers(options_);
|
||||
for(auto scorer : scorers)
|
||||
for(auto scorer : scorers) {
|
||||
scorer->init(graph);
|
||||
if(shortlistGenerator_)
|
||||
scorer->setShortlistGenerator(shortlistGenerator_);
|
||||
}
|
||||
scorers_.push_back(scorers);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user