MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / PredictorParams

Class PredictorParams

convert.py:142–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140
141@dataclass
142class PredictorParams:
143 sparse_threshold: float | None = None
144
145 @staticmethod
146 def loadPredictorJson(model: LazyModel, config_path: Path) -> PredictorParams:
147 config = json.load(open(config_path))
148 return PredictorParams(
149 sparse_threshold = config.get("sparse_threshold"),
150 )
151
152 @staticmethod
153 def load(model_plus: ModelPlus) -> PredictorParams:
154 config_path = model_plus.paths[0].parent / "config.json"
155
156 if config_path.exists():
157 params = PredictorParams.loadPredictorJson(model_plus.model, config_path)
158 else:
159 params = PredictorParams()
160
161 return params
162
163@dataclass
164class Params:

Callers 2

loadPredictorJsonMethod · 0.70
loadMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected