diff --git a/src/config.cpp b/src/config.cpp index 544033d42..16784a3f9 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -2,7 +2,7 @@ #include "json.h" #include #include -#include // std::cout warnings +#include // std::cout warnings namespace Generators { @@ -131,7 +131,7 @@ struct Model_Element : JSON::Element { if (name == "type") { v_.type = value; } else if (name == "logits_type") { - std::cout << "genai-config.json warning: logits_type is deprecated" << std::endl; // TODO: Remove once removed from model builder + std::cout << "genai-config.json warning: logits_type is deprecated" << std::endl; // TODO: Remove once removed from model builder } else if (name == "kv_type") { std::cout << "genai-config.json warning: kv_type is deprecated" << std::endl; // TODO: Remove once removed from model builder } else diff --git a/src/models/input_ids.cpp b/src/models/input_ids.cpp index 1268a588c..14a7d4124 100644 --- a/src/models/input_ids.cpp +++ b/src/models/input_ids.cpp @@ -13,7 +13,7 @@ InputIDs::InputIDs(const Model& model, State& state) type_ = model_.session_info_->GetInputDataType(name_); // If 64-bit, convert from 32-bit to 64-bit - if(type_==Ort::TypeToTensorType::type) { + if (type_ == Ort::TypeToTensorType::type) { value_ = OrtValue::CreateTensor(model.allocator_cpu_, shape_, type_); auto* p_data = value_->GetTensorMutableData(); for (auto v : state_.search_params_.input_ids) { @@ -45,7 +45,7 @@ void InputIDs::Update(RoamingArray next_tokens_unk) { } // Update input_ids with next tokens, converting from 32-bit to 64-bit - if(type_ == Ort::TypeToTensorType::type) { + if (type_ == Ort::TypeToTensorType::type) { auto* data = value_->GetTensorMutableData(); #if USE_CUDA if (model_.device_type_ == DeviceType::CUDA) { diff --git a/src/models/logits.cpp b/src/models/logits.cpp index 3fc05657f..176ff5c80 100644 --- a/src/models/logits.cpp +++ b/src/models/logits.cpp @@ -9,7 +9,6 @@ Logits::Logits(const Model& model, State& state) state_{state}, shape_{state_.search_params_.batch_size * state_.search_params_.num_beams, state_.search_params_.sequence_length, state_.search_params_.vocab_size}, type_{model_.session_info_->GetOutputDataType(model_.config_->model.decoder.outputs.logits)} { - value_ = OrtValue::CreateTensor(*model.allocator_device_, shape_, type_); if (model_.device_type_ == DeviceType::CPU && type_ != Ort::TypeToTensorType::type) diff --git a/src/models/model.cpp b/src/models/model.cpp index 66fa587b5..98cd8440f 100644 --- a/src/models/model.cpp +++ b/src/models/model.cpp @@ -139,7 +139,6 @@ Ort::Allocator* GetCudaAllocator(OrtSession& session) { #endif SessionInfo::SessionInfo(OrtSession& session) { - auto input_names = session.GetInputNames(); std::vector input_types(input_names.size()); for (size_t i = 0; i < input_types.size(); i++) { @@ -156,11 +155,11 @@ SessionInfo::SessionInfo(OrtSession& session) { } ONNXTensorElementDataType SessionInfo::GetInputDataType(const std::string& name) const { - return inputs_.find(name)->second; + return inputs_.find(name)->second; } ONNXTensorElementDataType SessionInfo::GetOutputDataType(const std::string& name) const { - return outputs_.find(name)->second; + return outputs_.find(name)->second; } Model::Model(std::unique_ptr config, const ProviderOptions* provider_options) : config_{std::move(config)} {