Skip to content

Commit

Permalink
Rebase conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
baijumeswani committed Jul 24, 2024
1 parent aea7898 commit a8f62e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/python/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,10 @@ PYBIND11_MODULE(onnxruntime_genai, m) {
throw std::runtime_error("Image processor is not available for this model.");
}
const Images* images = kwargs["images"].cast<const Images*>();
return std::make_unique<PyNamedTensors>(processor.image_processor_->Process(*processor.tokenizer_, prompt, images));
if (!prompt.has_value()) {
throw std::runtime_error("Prompt is required for processing the image.");
}
return std::make_unique<PyNamedTensors>(processor.image_processor_->Process(*processor.tokenizer_, *prompt, images));
} else if (kwargs.contains("audios")) {
const Audios* audios = kwargs["audios"].cast<const Audios*>();
return std::make_unique<PyNamedTensors>(processor.audio_processor_->Process(audios));
Expand Down

0 comments on commit a8f62e9

Please sign in to comment.