mtmd : allow custom video decoder (#32188)
* mtmd : allow custom video decoder * also adapt to wllama requirements * clean up * add test --------- Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
This commit is contained in:
1 parent
4f2187e73d
commit
e3483e40b0
8 files changed
+691
-531
No files matched your search
@@ -1416,6 +1416,8 @@ private:
|
||||
}
|
||||
|
||||
mtmd_cap = mtmd_helper_get_capabilities(model_tgt, mctx);
|
||||
// the helper only knows about the built-in video decoder
|
||||
mtmd_cap.video = mtmd_cap.video || (mtmd_cap.vision && init_opt.video_params.decoder != nullptr);
|
||||
|
||||
if (!llama_memory_can_shift(llama_get_memory(ctx_tgt))) {
|
||||
if (params_base.ctx_shift) {
|
||||
@@ -5332,6 +5334,10 @@ void server_context::set_state_callback(server_state_callback_t callback) {
|
||||
impl->callback_state = std::move(callback);
|
||||
}
|
||||
|
||||
void server_context::set_video_decoder(const mtmd_helper_video_decoder * decoder) {
|
||||
impl->init_opt.video_params.decoder = decoder;
|
||||
}
|
||||
|
||||
//
|
||||
// server_routes
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user