[Quant] [Bugfix] Fix quantization config matching with hf_to_vllm_mapper (#20046)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import itertools
|
||||
from collections.abc import Iterable, Mapping
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Callable, Literal, Optional, Protocol, Union, overload
|
||||
from typing import Any, Callable, Literal, Optional, Protocol, Union, overload
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
@@ -64,6 +64,19 @@ class WeightsMapper:
|
||||
return ((out_name, data) for name, data in weights
|
||||
if (out_name := self._map_name(name)) is not None)
|
||||
|
||||
def apply_list(self, values: list[str]) -> list[str]:
|
||||
return [
|
||||
out_name for name in values
|
||||
if (out_name := self._map_name(name)) is not None
|
||||
]
|
||||
|
||||
def apply_dict(self, values: dict[str, Any]) -> dict[str, Any]:
|
||||
return {
|
||||
out_name: value
|
||||
for name, value in values.items()
|
||||
if (out_name := self._map_name(name)) is not None
|
||||
}
|
||||
|
||||
|
||||
class AutoWeightsLoader:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user