Skip to content

Commit acea290

Browse files
youkaichaotlrmchlsmth
authored andcommitted
[misc][plugin] improve plugin loading (vllm-project#10443)
Signed-off-by: youkaichao <youkaichao@gmail.com> Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com>
1 parent 94d7bbe commit acea290

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

vllm/plugins/__init__.py

+7
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,19 @@
99

1010
logger = logging.getLogger(__name__)
1111

12+
# make sure one process only loads plugins once
13+
plugins_loaded = False
14+
1215

1316
def load_general_plugins():
1417
"""WARNING: plugins can be loaded for multiple times in different
1518
processes. They should be designed in a way that they can be loaded
1619
multiple times without causing issues.
1720
"""
21+
global plugins_loaded
22+
if plugins_loaded:
23+
return
24+
plugins_loaded = True
1825
import sys
1926
if sys.version_info < (3, 10):
2027
from importlib_metadata import entry_points

0 commit comments

Comments
 (0)