Skip to content

Commit 2fb2c0f

Browse files
authored
fix MultimodalRegistry (#3699)
1 parent 43d5bd6 commit 2fb2c0f

File tree

2 files changed

+2
-25
lines changed

2 files changed

+2
-25
lines changed

fastdeploy/engine/sched/resource_manager_v1.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,7 @@ def _get_num_new_tokens(self, request, token_budget):
137137
return num_new_tokens
138138

139139
inputs = request.multimodal_inputs
140-
if (
141-
inputs["image_feature_urls"] is not None
142-
or inputs["video_feature_urls"] is not None
143-
or inputs["audio_feature_urls"] is not None
144-
):
140+
if inputs["patch_idx"] is not None and inputs["patch_map"] is not None:
145141
pre_end_idx = request.num_computed_tokens
146142
new_end_idx = pre_end_idx + num_new_tokens
147143
# start

fastdeploy/multimodal/registry.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,13 @@
1414
# limitations under the License.
1515
"""
1616

17-
from typing import Callable
18-
1917

2018
class MultimodalRegistry:
2119
"""
2220
A registry for multimodal models
2321
"""
2422

25-
mm_models: set[str] = {"Ernie4_5_VLMoeForConditionalGeneration"}
26-
27-
@classmethod
28-
def register_model(cls, name: str = "") -> Callable:
29-
"""
30-
Register model with the given name, class name is used if name is not provided.
31-
"""
32-
33-
def _register(model):
34-
nonlocal name
35-
if len(name) == 0:
36-
name = model.__name__
37-
if name in cls.mm_models:
38-
raise ValueError(f"multimodal model {name} is already registered")
39-
cls.mm_models.add(name)
40-
return model
41-
42-
return _register
23+
mm_models: set[str] = {"Ernie4_5_VLMoeForConditionalGeneration", "Ernie5MoeForCausalLM"}
4324

4425
@classmethod
4526
def contains_model(cls, name: str) -> bool:

0 commit comments

Comments
 (0)