File tree Expand file tree Collapse file tree 7 files changed +31
-31
lines changed Expand file tree Collapse file tree 7 files changed +31
-31
lines changed Original file line number Diff line number Diff line change 3333 __VA_ARGS__ \
3434 break ; \
3535 } \
36+ case 3 : { \
37+ constexpr size_t NUM_EXPERTS_PER_RANK = 3 ; \
38+ __VA_ARGS__ \
39+ break ; \
40+ } \
3641 case 6 : { \
3742 constexpr size_t NUM_EXPERTS_PER_RANK = 6 ; \
3843 __VA_ARGS__ \
Original file line number Diff line number Diff line change @@ -71,17 +71,9 @@ def create_processor(self):
7171 """
7272 reasoning_parser_obj = None
7373 tool_parser_obj = None
74- try :
75- from fastdeploy .plugins .reasoning_parser import (
76- load_reasoning_parser_plugins ,
77- )
7874
79- custom_reasoning_parser = load_reasoning_parser_plugins ()
80- if self .reasoning_parser == "custom_reasoning_parser" :
81- reasoning_parser_obj = custom_reasoning_parser
82- except :
83- if self .reasoning_parser :
84- reasoning_parser_obj = ReasoningParserManager .get_reasoning_parser (self .reasoning_parser )
75+ if self .reasoning_parser :
76+ reasoning_parser_obj = ReasoningParserManager .get_reasoning_parser (self .reasoning_parser )
8577 if self .tool_parser :
8678 tool_parser_obj = ToolParserManager .get_tool_parser (self .tool_parser )
8779
Original file line number Diff line number Diff line change 2323def load_input_processor_plugins ():
2424 """load_input_processor_plugins"""
2525 plugins = load_plugins_by_group (group = PLUGINS_GROUP )
26- assert len (plugins ) <= 1 , "Most one plugin is allowed to be loaded."
26+ assert len (plugins ) == 1 , "Only one plugin is allowed to be loaded."
2727 return next (iter (plugins .values ()))()
Original file line number Diff line number Diff line change 1414# limitations under the License.
1515"""
1616
17- from fastdeploy .plugins .utils import load_plugins_by_group , plugins_loaded
17+ from fastdeploy .plugins .utils import load_plugins_by_group
1818
1919# use for modle runner
2020PLUGINS_GROUP = "fastdeploy.model_runner_plugins"
2121
2222
2323def load_model_runner_plugins ():
2424 """load_model_runner_plugins"""
25- global plugins_loaded
26- if plugins_loaded :
27- return
28- plugins_loaded = True
29-
3025 plugins = load_plugins_by_group (group = PLUGINS_GROUP )
31- assert len (plugins ) <= 1 , "Most one plugin is allowed to be loaded."
26+ assert len (plugins ) == 1 , "Only one plugin is allowed to be loaded."
3227 return next (iter (plugins .values ()))()
Original file line number Diff line number Diff line change 1414# limitations under the License.
1515"""
1616
17- from fastdeploy .plugins .utils import load_plugins_by_group
17+ from fastdeploy .plugins .utils import load_plugins_by_group , plugins_loaded
1818
1919# make sure one process only loads plugins once
2020PLUGINS_GROUP = "fastdeploy.reasoning_parser_plugins"
2121
2222
2323def load_reasoning_parser_plugins ():
2424 """load_reasoning_parser_plugins"""
25+ global plugins_loaded
26+ if plugins_loaded :
27+ return
28+ plugins_loaded = True
29+
2530 plugins = load_plugins_by_group (group = PLUGINS_GROUP )
26- assert len (plugins ) <= 1 , "Most one plugin is allowed to be loaded."
27- return next (iter (plugins .values ()))()
31+ # general plugins, we only need to execute the loaded functions
32+ for func in plugins .values ():
33+ func ()
Original file line number Diff line number Diff line change 1414# limitations under the License.
1515"""
1616
17+ from fastdeploy .plugins import load_reasoning_parser_plugins
18+
1719from .abs_reasoning_parsers import ReasoningParser , ReasoningParserManager
1820from .ernie_vl_reasoning_parsers import ErnieVLReasoningParser
1921from .ernie_x1_reasoning_parsers import ErnieX1ReasoningParser
2628 "Qwen3ReasoningParser" ,
2729 "ErnieX1ReasoningParser" ,
2830]
31+
32+ load_reasoning_parser_plugins ()
Original file line number Diff line number Diff line change 1+ """
12# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
2- #
3- #
4- from collections .abc import Sequence
5- from typing import Tuple , Union
6-
7- from fastdeploy .entrypoints .openai .protocol import ChatCompletionRequest , DeltaMessage
8- from fastdeploy .reasoning import ReasoningParser , ReasoningParserManager
9-
10- #
11- #
123# Licensed under the Apache License, Version 2.0 (the "License"
134# you may not use this file except in compliance with the License.
145# You may obtain a copy of the License at
2011# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2112# See the License for the specific language governing permissions and
2213# limitations under the License.
14+ """
15+
16+ from collections .abc import Sequence
17+ from typing import Tuple , Union
18+
19+ from fastdeploy .entrypoints .openai .protocol import ChatCompletionRequest , DeltaMessage
20+ from fastdeploy .reasoning import ReasoningParser , ReasoningParserManager
2321
2422
2523@ReasoningParserManager .register_module ("ernie_x1" )
You can’t perform that action at this time.
0 commit comments