MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / _map_name

Method _map_name

fastdeploy/model_executor/utils.py:203–207  ·  view source on GitHub ↗
(self, key: str)

Source from the content-addressed store, hash-verified

201 orig_to_new_prefix: Mapping[str, Optional[str]] = field(default_factory=dict)
202
203 def _map_name(self, key: str) -> Optional[str]:
204 for prefix, new_key in self.orig_to_new_prefix.items():
205 if key.startswith(prefix):
206 key = key.replace(prefix, new_key, 1)
207 return key
208
209 def apply(self, weight_name):
210 return self._map_name(weight_name)

Callers 1

applyMethod · 0.95

Calls 1

itemsMethod · 0.80

Tested by

no test coverage detected