MCPcopy Index your code
hub / github.com/modelscope/modelscope / register_modelhub_repo

Function register_modelhub_repo

modelscope/utils/plugins.py:465–476  ·  view source on GitHub ↗

Try to install and import remote model from modelhub

(model_dir, allow_remote=False)

Source from the content-addressed store, hash-verified

463
464
465def register_modelhub_repo(model_dir, allow_remote=False) -> None:
466 """ Try to install and import remote model from modelhub"""
467 if allow_remote:
468 logger.warning(
469 f'Use allow_remote=True. Will invoke codes from {model_dir}. Please make sure '
470 'that you can trust the external codes.')
471 try:
472 import_module_from_model_dir(model_dir)
473 except KeyError:
474 logger.warning(
475 'Multi component keys in the hub are registered in same file')
476 pass
477
478
479DEFAULT_INDEX = 'https://pypi.org/simple/'

Callers 3

pipelineFunction · 0.90
build_trainerFunction · 0.90
from_pretrainedMethod · 0.90

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…