MCPcopy Create free account
hub / github.com/modelscope/modelscope / patch_context

Function patch_context

modelscope/utils/hf_util/patcher.py:1015–1020  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1013
1014@contextlib.contextmanager
1015def patch_context():
1016 patch_hub()
1017 try:
1018 yield
1019 finally:
1020 unpatch_hub()

Callers 12

test_patch_modelMethod · 0.90
test_patch_configMethod · 0.90
test_patch_diffusersMethod · 0.90
test_patch_peftMethod · 0.90
test_who_am_iMethod · 0.90
test_push_to_hubMethod · 0.90

Calls 2

patch_hubFunction · 0.85
unpatch_hubFunction · 0.85

Tested by 12

test_patch_modelMethod · 0.72
test_patch_configMethod · 0.72
test_patch_diffusersMethod · 0.72
test_patch_peftMethod · 0.72
test_who_am_iMethod · 0.72
test_push_to_hubMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…