MCPcopy Index your code
hub / github.com/modelscope/FunASR / prepare_model_dir

Function prepare_model_dir

funasr/utils/misc.py:109–129  ·  view source on GitHub ↗

Prepare model dir. Args: **kwargs: Additional keyword arguments.

(**kwargs)

Source from the content-addressed store, hash-verified

107
108
109def prepare_model_dir(**kwargs):
110
111 """Prepare model dir.
112
113 Args:
114 **kwargs: Additional keyword arguments.
115 """
116 os.makedirs(kwargs.get("output_dir", "./"), exist_ok=True)
117
118 yaml_file = os.path.join(kwargs.get("output_dir", "./"), "config.yaml")
119 OmegaConf.save(config=kwargs, f=yaml_file)
120 logging.info(f"kwargs: {kwargs}")
121 logging.info("config.yaml is saved to: %s", yaml_file)
122
123 model_path = kwargs.get("model_path", None)
124 if model_path is not None:
125 config_json = os.path.join(model_path, "configuration.json")
126 if os.path.exists(config_json):
127 shutil.copy(
128 config_json, os.path.join(kwargs.get("output_dir", "./"), "configuration.json")
129 )
130
131
132def extract_filename_without_extension(file_path):

Callers 2

mainFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…