Skip to content

Commit

Permalink
[misc][plugin] improve plugin loading (vllm-project#10443)
Browse files Browse the repository at this point in the history
Signed-off-by: youkaichao <[email protected]>
  • Loading branch information
youkaichao authored and weilong.yu committed Dec 13, 2024
1 parent 19d3015 commit f08162a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vllm/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@

logger = logging.getLogger(__name__)

# make sure one process only loads plugins once
plugins_loaded = False


def load_general_plugins():
"""WARNING: plugins can be loaded for multiple times in different
processes. They should be designed in a way that they can be loaded
multiple times without causing issues.
"""
global plugins_loaded
if plugins_loaded:
return
plugins_loaded = True
import sys
if sys.version_info < (3, 10):
from importlib_metadata import entry_points
Expand Down

0 comments on commit f08162a

Please sign in to comment.