Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
1015
def
patch_context():
1016
patch_hub()
1017
try
:
1018
yield
1019
finally:
1020
unpatch_hub()
Callers
12
test_patch_context_round_trip
Method · 0.90
test_patch_hub_then_kernels_get_kernel
Method · 0.90
test_transformer_patch
Method · 0.90
test_patch_model
Method · 0.90
test_patch_config
Method · 0.90
test_patch_diffusers
Method · 0.90
test_patch_peft
Method · 0.90
test_patch_file_exists
Method · 0.90
test_patch_file_download
Method · 0.90
test_patch_create_repo
Method · 0.90
test_who_am_i
Method · 0.90
test_push_to_hub
Method · 0.90
Calls
2
patch_hub
Function · 0.85
unpatch_hub
Function · 0.85
Tested by
12
test_patch_context_round_trip
Method · 0.72
test_patch_hub_then_kernels_get_kernel
Method · 0.72
test_transformer_patch
Method · 0.72
test_patch_model
Method · 0.72
test_patch_config
Method · 0.72
test_patch_diffusers
Method · 0.72
test_patch_peft
Method · 0.72
test_patch_file_exists
Method · 0.72
test_patch_file_download
Method · 0.72
test_patch_create_repo
Method · 0.72
test_who_am_i
Method · 0.72
test_push_to_hub
Method · 0.72
Used in the wild
real call sites across dependent graphs
searching dependent graphs…