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

Function _unpatch_kernels

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

Source from the content-addressed store, hash-verified

536
537
538def _unpatch_kernels():
539 try:
540 from kernels import utils as kernels_utils
541 from kernels.utils import _get_hf_api
542 except ImportError:
543 return
544 origin = getattr(kernels_utils, '_get_hf_api_origin', None)
545 if origin is not None:
546 kernels_utils._get_hf_api = origin
547 del kernels_utils._get_hf_api_origin
548
549
550def _ms_revision(revision):

Callers 5

setUpMethod · 0.90
tearDownMethod · 0.90
_kernels_patch_scopeFunction · 0.85
unpatch_hubFunction · 0.85

Calls

no outgoing calls

Tested by 3

setUpMethod · 0.72
tearDownMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…