mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-19 12:57:58 +00:00
monkey patch fixes
This commit is contained in:
parent
0d71de18d8
commit
4348345dac
1 changed files with 15 additions and 1 deletions
|
|
@ -87,7 +87,19 @@ def _maybe_apply_patches() -> bool:
|
|||
return False
|
||||
|
||||
try:
|
||||
from .vllm_patching import apply_patches
|
||||
# Try relative import first (when run as module)
|
||||
try:
|
||||
from .vllm_patching import apply_patches
|
||||
except ImportError:
|
||||
# Fall back to absolute import (when run as script)
|
||||
import sys
|
||||
from pathlib import Path
|
||||
# Add the example_trainer directory to path
|
||||
script_dir = Path(__file__).parent
|
||||
if str(script_dir) not in sys.path:
|
||||
sys.path.insert(0, str(script_dir))
|
||||
from vllm_patching import apply_patches
|
||||
|
||||
apply_patches()
|
||||
logger.info("✓ vLLM patches applied for shared memory weights")
|
||||
return True
|
||||
|
|
@ -97,6 +109,8 @@ def _maybe_apply_patches() -> bool:
|
|||
return False
|
||||
except Exception as e:
|
||||
logger.warning(f"Failed to apply patches: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
return False
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue