MCPcopy Create free account
hub / github.com/InternScience/SciReason / model_pt

Function model_pt

opencompass/utils/fileio.py:285–297  ·  view source on GitHub ↗
(cls, pretrained_model_name_or_path, *args, **kwargs)

Source from the content-addressed store, hash-verified

283
284 @classmethod
285 def model_pt(cls, pretrained_model_name_or_path, *args, **kwargs):
286 kwargs['cache_dir'] = cache_dir
287 if not isinstance(get_file_backend(pretrained_model_name_or_path),
288 LocalBackend):
289 kwargs['local_files_only'] = True
290 if cache_dir is not None and not isinstance(
291 get_file_backend(cache_dir), LocalBackend):
292 kwargs['local_files_only'] = True
293
294 with patch_fileio():
295 res = ori_model_pt.__func__(cls, pretrained_model_name_or_path,
296 *args, **kwargs)
297 return res
298
299 PreTrainedModel.from_pretrained = model_pt
300

Callers

nothing calls this directly

Calls 1

patch_fileioFunction · 0.85

Tested by

no test coverage detected