MCPcopy Index your code
hub / github.com/NVIDIA/Stable-Diffusion-WebUI-TensorRT / read_json

Method read_json

model_manager.py:159–172  ·  view source on GitHub ↗
(self, encode_config=True)

Source from the content-addressed store, hash-verified

157 json.dump(self.all_models, f, indent=4, cls=ModelConfigEncoder)
158
159 def read_json(self, encode_config=True):
160 with open(self.model_file, "r") as f:
161 out = json.load(f)
162
163 if not encode_config:
164 return out
165
166 for cc, models in out.items():
167 for base_model, configs in models.items():
168 for i in range(len(configs)):
169 out[cc][base_model][i]["config"] = ModelConfig(
170 **configs[i]["config"]
171 )
172 return out
173
174 def available_models(self):
175 available = self.all_models.get(self.cc, {})

Callers 1

__init__Method · 0.95

Calls 2

ModelConfigClass · 0.90
loadMethod · 0.80

Tested by

no test coverage detected