Skip to content
Prev Previous commit
Next Next commit
mbridge importing
  • Loading branch information
ISEEKYAN committed Jun 20, 2025
commit 94b9cd7b06e0cb55cef8c1a085682e349a199ce2
17 changes: 2 additions & 15 deletions verl/models/mcore/mbridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,7 @@
from mbridge import AutoBridge
from mbridge.utils.post_creation_callbacks import freeze_moe_router, make_value_model
except ImportError:
import subprocess
import sys

print("mbridge package not found. This package is required for model bridging functionality.")
print("Install mbridge with `pip install mbridge`")

def install_mbridge():
try:
subprocess.check_call([sys.executable, "-m", "pip", "install", "mbridge"])
except subprocess.CalledProcessError:
print("Failed to install mbridge")
raise

install_mbridge()
from mbridge import *
print("mbridge package not found. Please install mbridge with `pip install verl[mcore]` or `pip install mbridge`")
raise

__all__ = ["AutoBridge", "make_value_model", "freeze_moe_router"]