Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/generators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,10 @@ Generator::Generator(const Model& model, const GeneratorParams& params) : model_
throw std::runtime_error("search max_length is 0");
if (params.search.max_length > model.config_->model.context_length)
throw std::runtime_error("max_length (" + std::to_string(params.search.max_length) + ") cannot be greater than model context_length (" + std::to_string(model.config_->model.context_length) + ")");
if (params.search.batch_size < 1)
throw std::runtime_error("batch_size must be 1 or greater, is " + std::to_string(params.search.batch_size));
if (params.search.batch_size < 1 || params.search.batch_size > 256)
throw std::runtime_error("batch_size (" + std::to_string(params.search.batch_size) + ") must be in [1, 256]");
if (params.search.num_beams < 1 || params.search.num_beams > 256)
throw std::runtime_error("num_beams (" + std::to_string(params.search.num_beams) + ") must be in [1, 256]");
Comment thread
apsonawane marked this conversation as resolved.
Outdated
Comment thread
apsonawane marked this conversation as resolved.
Outdated
if (params.config.model.vocab_size < 1)
throw std::runtime_error("vocab_size must be 1 or greater, is " + std::to_string(params.config.model.vocab_size));

Expand Down
Loading