mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-23 00:17:25 +08:00
* fix mtp * fix --------- Co-authored-by: Jiang-Jia-Jun <163579578+Jiang-Jia-Jun@users.noreply.github.com>
This commit is contained in:
@@ -166,6 +166,13 @@ class WeightsMapper:
|
||||
return self._map_name(weight_name)
|
||||
|
||||
|
||||
def remap_weight_keys(weights_iterator, mapper: dict):
|
||||
return (
|
||||
(next((key.replace(k, v) for k, v in mapper.items() if k in key), key), value)
|
||||
for key, value in weights_iterator
|
||||
)
|
||||
|
||||
|
||||
def process_weights_before_loading(
|
||||
*, skip_prefixes: Optional[List[str]] = None, mapper: Optional[WeightsMapper] = None
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user