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
4 changes: 2 additions & 2 deletions src/models/embeddings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Embeddings::Embeddings(State& state, Embeddings::Mode mode, const std::string& n
// So only create the transient input and reuse that ortvalue for previous
// steps in the pipeline.
if (mode == Embeddings::Mode::Input) {
embeddings_ = OrtValue::CreateTensor(model_.p_device_->GetAllocator(), shape_, type_);
embeddings_ = OrtValue::CreateTensor(model_.p_device_inputs_->GetAllocator(), shape_, type_);
}
}

Expand Down Expand Up @@ -49,7 +49,7 @@ void Embeddings::UpdateSequenceLength(size_t new_length) {
shape_[1] = new_length;

if (mode_ == Embeddings::Mode::Input) {
embeddings_ = OrtValue::CreateTensor(model_.p_device_->GetAllocator(), shape_, type_);
embeddings_ = OrtValue::CreateTensor(model_.p_device_inputs_->GetAllocator(), shape_, type_);
state_.inputs_[index_] = embeddings_.get();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/models/multi_modal_features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void MultiModalFeatures::Update(bool is_prompt) {
// num_feature_tokens will be 0 when no image is provided
if (!is_prompt && shape_[shape_.size() - 2] > 0) { // if num_image_tokens > 0
shape_[shape_.size() - 2] = 0;
features_ = OrtValue::CreateTensor(model_.p_device_->GetAllocator(), shape_, type_);
features_ = OrtValue::CreateTensor(model_.p_device_inputs_->GetAllocator(), shape_, type_);
state_.inputs_[index_] = features_.get();
}
}
Expand All @@ -82,7 +82,7 @@ void MultiModalFeatures::AllocateEmptyFeatures() {
// Skip if already allocated (avoids redundant allocation when called from
// both EmbeddingState::SetExtraInputs and the pipeline prompt path)
if (features_ && state_.inputs_[index_] == features_.get()) return;
features_ = OrtValue::CreateTensor(model_.p_device_->GetAllocator(), shape_, type_);
features_ = OrtValue::CreateTensor(model_.p_device_inputs_->GetAllocator(), shape_, type_);
state_.inputs_[index_] = features_.get();
}

Expand Down
Loading