Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/models/input_ids.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void DefaultInputIDs::Update(DeviceSpan<int32_t> new_tokens) {
WindowedInputIDs::WindowedInputIDs(State& state) : state_{state} {
if (model_.p_device_inputs_->GetType() != DeviceType::QNN &&
model_.p_device_inputs_->GetType() != DeviceType::CPU) {
throw std::runtime_error("Sliding a window over input_ids works with either the QNN or the CPU provider.");
throw std::runtime_error("Sliding a window over input_ids only works with either the QNN or the CPU provider.");
}

name_ = model_.config_->model.decoder.inputs.input_ids.c_str();
Expand Down
5 changes: 4 additions & 1 deletion src/models/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ DeviceInterface* SetProviderSessionOptions(OrtSessionOptions& session_options,
auto providers_list = providers;
if (!is_primary_session_options) {
// Providers specified in a non-primary provider options list are added
// to the primary providers. They are considered immutable and implcitly
// to the primary providers. They are considered immutable and implicitly
// added as providers.
std::transform(provider_options_list.begin(), provider_options_list.end(), std::back_inserter(providers_list),
[](const auto& provider_options) { return provider_options.name; });
Expand Down Expand Up @@ -642,6 +642,9 @@ void Model::CreateSessionOptionsFromConfig(const Config::SessionOptions& config_

if (!p_device_) {
p_device_ = session_device;
} else if (session_device != nullptr && session_device->GetType() != p_device_->GetType()) {
throw std::runtime_error("Running a model with multiple providers is not supported. Encountered " +
to_string(session_device->GetType()) + " and " + to_string(p_device_->GetType()));
}
}

Expand Down